Ejemplo n.º 1
0
 def test_parse_comment_data_string_no_value(self):
     comment_data_string = "#data:: entry1 : entry2: key = "
     path, (key, value) = GRIMMReader.parse_comment_data_string(
         comment_data_string=comment_data_string)
     self.assertListEqual(path, ["entry1", "entry2"])
     self.assertEqual(key, "key")
     self.assertEqual(value, "")
     comment_data_string = "#data:: key = "
     path, (key, value) = GRIMMReader.parse_comment_data_string(
         comment_data_string=comment_data_string)
     self.assertListEqual(path, [])
     self.assertEqual(key, "key")
     self.assertEqual(value, "")
Ejemplo n.º 2
0
 def test_parse_comment_data_string_no_key_value(self):
     comment_data_string = "#data:: "
     path, (key, value) = GRIMMReader.parse_comment_data_string(
         comment_data_string=comment_data_string)
     self.assertListEqual(path, [])
     self.assertEqual(key, "")
     self.assertEqual(value, "")
     comment_data_string = "#data:: = "
     path, (key, value) = GRIMMReader.parse_comment_data_string(
         comment_data_string=comment_data_string)
     self.assertListEqual(path, [])
     self.assertEqual(key, "")
     self.assertEqual(value, "")
Ejemplo n.º 3
0
 def test_parse_comment_data_string_top_level(self):
     comment_data_string = "# data :: key=value"
     path, (key, value) = GRIMMReader.parse_comment_data_string(
         comment_data_string=comment_data_string)
     self.assertListEqual(path, [])
     self.assertEqual(key, "key")
     self.assertEqual(value, "value")
     comment_data_string = "#data::key = value"
     path, (key, value) = GRIMMReader.parse_comment_data_string(
         comment_data_string=comment_data_string)
     self.assertListEqual(path, [])
     self.assertEqual(key, "key")
     self.assertEqual(value, "value")
Ejemplo n.º 4
0
 def test_parse_comment_data_string(self):
     data_string = "# data :: fragment : name = scaffold1"
     path, (key, value) = GRIMMReader.parse_comment_data_string(
         comment_data_string=data_string)
     self.assertEqual(path, ["fragment"])
     self.assertEqual(key, "name")
     self.assertEqual(value, "scaffold1")
     data_string = "# data :: fragment : origin: name = ALLPATHS-LG"
     path, (key, value) = GRIMMReader.parse_comment_data_string(
         comment_data_string=data_string)
     self.assertEqual(path, ["fragment", "origin"])
     self.assertEqual(key, "name")
     self.assertEqual(value, "ALLPATHS-LG")
     data_string = "# data :: genome : origin: name = ALLPATHS-LG"
     path, (key, value) = GRIMMReader.parse_comment_data_string(
         comment_data_string=data_string)
     self.assertEqual(path, ["genome", "origin"])
     self.assertEqual(key, "name")
     self.assertEqual(value, "ALLPATHS-LG")