File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
import unittest
2
2
from loklak import Loklak
3
+ import os
3
4
4
5
5
6
class TestLoklak (unittest .TestCase ):
@@ -8,6 +9,12 @@ def setUp(self):
8
9
"""test proper setup"""
9
10
self .loklak = Loklak ()
10
11
12
+ def tearDown (self ):
13
+ try :
14
+ os .remove (self .map_file )
15
+ except OSError as error :
16
+ print (error )
17
+
11
18
def test_hello (self ):
12
19
"""test hello instance"""
13
20
result = self .loklak .hello ()
@@ -85,6 +92,15 @@ def test_user(self):
85
92
self .assertTrue ('name' in result ['user' ])
86
93
self .assertTrue ('screen_name' in result ['user' ])
87
94
95
+ def test_get_map (self ):
96
+ self .map_file = os .path .join (os .getcwd (), 'markdown.png' )
97
+ data = self .loklak .get_map (17.582729 , 79.118320 )
98
+ with open (self .map_file , 'wb' ) as f :
99
+ f .write (data )
100
+ with open (self .map_file , 'rb' ) as f :
101
+ file_contents = f .read ()
102
+ self .assertTrue (os .path .exists (self .map_file ))
103
+ self .assertEqual (data , file_contents )
88
104
89
105
if __name__ == '__main__' :
90
106
unittest .main ()
You can’t perform that action at this time.
0 commit comments