Ejemplo n.º 1
0
 def test_complex(self):
     test1 = os.path.join(dirname, 'TestCase/5/dir1/dir2/dir3/dir4',
                          'test5.yaml')
     test1_ans = os.path.join(dirname, 'TestCase/expected', '5.yaml')
     with open(test1_ans) as file:
         documents = yaml.load(file, Loader=yaml.FullLoader)
     self.assertEqual(MergingScript(test1).main(), documents)
Ejemplo n.º 2
0
 def test_empty_file_outer(self):
     test1 = os.path.join(dirname, r'TestCase/7/test/test', 'test7.yaml')
     test1_ans = os.path.join(dirname, r'TestCase/expected', '7.yaml')
     with open(test1_ans) as file:
         documents = yaml.load(file, Loader=yaml.FullLoader)
     self.assertEqual(MergingScript(test1).main(), documents)
Ejemplo n.º 3
0
 def test_sister_folder_present(self):
     test1 = os.path.join(dirname, 'TestCase/4/test/test', 'test4.yaml')
     test1_ans = os.path.join(dirname, r'TestCase/expected', '4.yaml')
     with open(test1_ans) as file:
         documents = yaml.load(file, Loader=yaml.FullLoader)
     self.assertEqual(MergingScript(test1).main(), documents)
Ejemplo n.º 4
0
 def test_given_nested_key_value(self):
     test1 = os.path.join(dirname, 'TestCase/3/test', 'test3.yaml')
     test1_ans = os.path.join(dirname, 'TestCase/expected', '3.yaml')
     with open(test1_ans) as file:
         documents = yaml.load(file, Loader=yaml.FullLoader)
     self.assertEqual(MergingScript(test1).main(), documents)
Ejemplo n.º 5
0
 def test_given_int_and_string(self):
     test1 = os.path.join(dirname, 'TestCase/1/test', 'test1.yaml')
     test1_ans = os.path.join(dirname, 'TestCase/expected', '1.yaml')
     with open(test1_ans) as file:
         documents = yaml.load(file, Loader=yaml.FullLoader)
     self.assertEqual(MergingScript(test1).main(), documents)
Ejemplo n.º 6
0
 def test_fail_invalid_dir(self):
     test1 = os.path.join(dirname, r'TestCase/0/test/test', 'test0.yaml')
     self.assertRaises(TypeError, MergingScript(test1).main())
Ejemplo n.º 7
0
 def test_fail_invalid_yaml(self):
     test1 = os.path.join(dirname, 'TestCase/0', 'test0.docx')
     self.assertRaises(TypeError, MergingScript(test1).main())