@@ -27,36 +27,41 @@ def venue():
2727 return Venue (TestVenue .location ,
2828 TestVenue .title ,
2929 TestVenue .address ,
30- foursquare_id = TestVenue .foursquare_id )
30+ foursquare_id = TestVenue .foursquare_id ,
31+ foursquare_type = TestVenue .foursquare_type )
3132
3233
3334class TestVenue (object ):
3435 location = Location (longitude = - 46.788279 , latitude = - 23.691288 )
3536 title = 'title'
3637 address = 'address'
3738 foursquare_id = 'foursquare id'
39+ foursquare_type = 'foursquare type'
3840
3941 def test_de_json (self , bot ):
4042 json_dict = {
4143 'location' : TestVenue .location .to_dict (),
4244 'title' : TestVenue .title ,
4345 'address' : TestVenue .address ,
44- 'foursquare_id' : TestVenue .foursquare_id
46+ 'foursquare_id' : TestVenue .foursquare_id ,
47+ 'foursquare_type' : TestVenue .foursquare_type
4548 }
4649 venue = Venue .de_json (json_dict , bot )
4750
4851 assert venue .location == self .location
4952 assert venue .title == self .title
5053 assert venue .address == self .address
5154 assert venue .foursquare_id == self .foursquare_id
55+ assert venue .foursquare_type == self .foursquare_type
5256
5357 def test_send_with_venue (self , monkeypatch , bot , chat_id , venue ):
5458 def test (_ , url , data , ** kwargs ):
5559 return (data ['longitude' ] == self .location .longitude
5660 and data ['latitude' ] == self .location .latitude
5761 and data ['title' ] == self .title
5862 and data ['address' ] == self .address
59- and data ['foursquare_id' ] == self .foursquare_id )
63+ and data ['foursquare_id' ] == self .foursquare_id
64+ and data ['foursquare_type' ] == self .foursquare_type )
6065
6166 monkeypatch .setattr ('telegram.utils.request.Request.post' , test )
6267 message = bot .send_venue (chat_id , venue = venue )
@@ -74,6 +79,7 @@ def test_to_dict(self, venue):
7479 assert venue_dict ['title' ] == venue .title
7580 assert venue_dict ['address' ] == venue .address
7681 assert venue_dict ['foursquare_id' ] == venue .foursquare_id
82+ assert venue_dict ['fousquare_type' ] == venue .foursquare_type
7783
7884 def test_equality (self ):
7985 a = Venue (Location (0 , 0 ), self .title , self .address )
0 commit comments