コード例 #1
0
ファイル: test_namespace.py プロジェクト: migibert/pynetlib
 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')
コード例 #2
0
ファイル: steps.py プロジェクト: migibert/pynetlib
def step_impl(context, namespace_name):
    namespace = Namespace(namespace_name)
    assert not namespace.exists()
コード例 #3
0
ファイル: test_namespace.py プロジェクト: migibert/pynetlib
 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')
コード例 #4
0
ファイル: test_namespace.py プロジェクト: migibert/pynetlib
 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')