Example #1
0
 def test_factory_uses_correct_default_transport(self):
     pushalot = PushalotFactory.create(
         token='some-token',
     )
     self.assertEqual(pushalot._transport.__class__.__name__, 'HTTPTransport')
Example #2
0
 def test_invalid_transport_raises(self):
     with self.assertRaises(RuntimeError):
         pushalot = PushalotFactory.create(
             token='some-token',
             transport=DummyTransport
         )
Example #3
0
 def test_valid_transport_success(self):
     pushalot = PushalotFactory.create(
         token='some-token',
         transport=HTTPTransport
     )
Example #4
0
 def test_factory_initiates_correct_default_api(self):
     pushalot = PushalotFactory.create(
         token='some-token',
     )
     self.assertEqual(pushalot.__class__.__name__, 'APILatest')
Example #5
0
 def test_valid_api_used_success(self):
     pushalot = PushalotFactory.create(
         token='some-token',
         api=APILatest
     )
Example #6
0
 def test_invalid_api_raises_exception(self):
     with self.assertRaises(RuntimeError):
         pushalot = PushalotFactory.create(
             token='some-token',
             api=DummyAPI
         )
Example #7
0
 def test_with_token_success(self):
     pushalot = PushalotFactory.create(token='some-token')
Example #8
0
 def test_without_token_raises_exception(self):
     with self.assertRaises(TypeError):
         pushalot = PushalotFactory.create()