コード例 #1
0
 def test_token_successfully_obtained(self):
     time_now = date_utils.get_datetime_utc_now()
     registrar = InternalTriggerTypesRegistrar()
     self.assertTrue(registrar._auth_creds is not None)
     # TTL is at least 10 mins
     self.assertTrue(
         (registrar._auth_creds.expiry - time_now).seconds > 10 * 60)
     delete_token(registrar._auth_creds.token)
コード例 #2
0
 def test_is_triger_type_exists_sad_case(self):
     registrar = InternalTriggerTypesRegistrar()
     is_exists = registrar._is_triggertype_exists('bar.foo')
     self.assertEqual(is_exists, False)
     delete_token(registrar._auth_creds.token)
コード例 #3
0
 def test_get_trigger_type_url(self):
     registrar = InternalTriggerTypesRegistrar()
     url = registrar._get_trigger_type_url('foo.bar')
     self.assertEqual(url, 'http://localhost:9101/v1/triggertypes/foo.bar')
     delete_token(registrar._auth_creds.token)
コード例 #4
0
 def test_is_triger_type_exists_sad_case(self):
     registrar = InternalTriggerTypesRegistrar()
     is_exists = registrar._is_triggertype_exists('bar.foo')
     self.assertEqual(is_exists, False)
     delete_token(registrar._auth_creds.token)
コード例 #5
0
 def test_get_trigger_type_url(self):
     registrar = InternalTriggerTypesRegistrar()
     url = registrar._get_trigger_type_url('foo.bar')
     self.assertEqual(url, 'http://localhost:9101/v1/triggertypes/foo.bar')
     delete_token(registrar._auth_creds.token)