예제 #1
0
 def test_get_command_context_mixed(self):
     with self.assertRaises(CLIError) as cm:
         _get_command_context([".", _get_test_data_file("ns.yaml")])
     self.assertEqual(
         str(cm.exception),
         '. is used to attach current folder, not expecting other attachements.'
     )
예제 #2
0
 def test_get_command_context_valid(self):
     context = _get_command_context([
         _get_test_data_file("ns.yaml"),
         _get_test_data_file("dummy.json")
     ])
     self.assertNotEqual(context, '')
예제 #3
0
 def test_get_command_context_empty(self):
     context = _get_command_context([])
     self.assertEqual(context, "")
예제 #4
0
 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))