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