def test_namespace_existence(self, execute_command, unify): execute_command.side_effect = ['namespace'] namespace = Namespace('namespace') result = namespace.exists() self.assertTrue(result) unify.assert_called_once_with() execute_command.assert_called_once_with('ip netns list')
def step_impl(context, namespace_name): namespace = Namespace(namespace_name) assert not namespace.exists()
def test_non_existing_namespace_existence(self, execute_command, unify): namespace = Namespace('namespace') result = namespace.exists() self.assertFalse(result) unify.assert_called_once_with() execute_command.assert_called_once_with('ip netns list')
def test_default_namespace_existence(self, execute_command, unify): namespace = Namespace(Namespace.DEFAULT_NAMESPACE_NAME) result = namespace.exists() self.assertTrue(result) unify.assert_called_once_with() execute_command.assert_called_once_with('ip netns list')