Exemplo n.º 1
0
 def test_get_command_context_mixed(self):
     with self.assertRaises(CLIError) as cm:
         _get_command_context(
             [".", _get_test_data_file("kubeletconfig.json")])
     self.assertEqual(
         str(cm.exception),
         '. is used to attach current folder, not expecting other attachements.'
     )
 def test_get_command_context_valid(self):
     context = _get_command_context(
         [_get_test_data_file("kubeletconfig.json"), _get_test_data_file("linuxosconfig.json")])
     self.assertNotEqual(context, '')
 def test_get_command_context_empty(self):
     context = _get_command_context([])
     self.assertEqual(context, "")
 def test_get_command_context_invalid_file(self):
     with self.assertRaises(CLIError) as cm:
         _get_command_context([_get_test_data_file("notexistingfile")])
     self.assertIn('notexistingfile is not valid file, or not accessable.', str(
         cm.exception))