Esempio n. 1
0
 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')
Esempio n. 2
0
def step_impl(context, namespace_name):
    namespace = Namespace(namespace_name)
    assert not namespace.exists()
Esempio n. 3
0
 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')
Esempio n. 4
0
 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')