예제 #1
0
 def test_basic(self):
     sot = profile_type.ProfileType()
     self.assertEqual('profile_type', sot.resource_key)
     self.assertEqual('profile_types', sot.resources_key)
     self.assertEqual('/profile-types', sot.base_path)
     self.assertTrue(sot.allow_fetch)
     self.assertTrue(sot.allow_list)
 def test_basic(self):
     sot = profile_type.ProfileType()
     self.assertEqual('profile_type', sot.resource_key)
     self.assertEqual('profile_types', sot.resources_key)
     self.assertEqual('/profile-types', sot.base_path)
     self.assertEqual('clustering', sot.service.service_type)
     self.assertTrue(sot.allow_get)
     self.assertTrue(sot.allow_list)
예제 #3
0
    def test_ops(self):
        sot = profile_type.ProfileType(**FAKE)

        resp = mock.Mock()
        resp.json = mock.Mock(return_value='')
        sess = mock.Mock()
        sess.get = mock.Mock(return_value=resp)
        self.assertEqual('', sot.type_ops(sess))
        url = 'profile-types/%s/ops' % sot.id
        sess.get.assert_called_once_with(url)
 def test_instantiate(self):
     sot = profile_type.ProfileType(**FAKE)
     self.assertEqual(FAKE['name'], sot._get_id(sot))
     self.assertEqual(FAKE['name'], sot.name)
     self.assertEqual(FAKE['schema'], sot.schema)
     self.assertEqual(FAKE['support_status'], sot.support_status)