def test_is_temporary(self): prefix = utils.KeystoneScenario.RESOURCE_NAME_PREFIX tests = [(fakes.FakeResource(name=prefix + "abc"), True), (fakes.FakeResource(name="another"), False), (fakes.FakeResource(name=prefix[:-3] + "abc"), False)] for resource, is_valid in tests: self.assertEqual(utils.is_temporary(resource), is_valid)
def test_is_temporary(self): prefix = utils.KeystoneScenario.RESOURCE_NAME_PREFIX tests = [ (fakes.FakeResource(name=prefix + "abc"), True), (fakes.FakeResource(name="another"), False), (fakes.FakeResource(name=prefix[:-3] + "abc"), False) ] for resource, is_valid in tests: self.assertEqual(utils.is_temporary(resource), is_valid)
def test_is_temporary(self, mock_name_matches_object): resource = mock.Mock() self.assertEqual(utils.is_temporary(resource), mock_name_matches_object.return_value) mock_name_matches_object.assert_called_once_with( resource.name, utils.KeystoneScenario)
def test_is_temporary(self, mock_name_matches_object): resource = mock.Mock() self.assertEqual(utils.is_temporary(resource), mock_name_matches_object.return_value) mock_name_matches_object.assert_called_once_with( resource.name, utils.KeystoneScenario)