Пример #1
0
 def test_seperator_change(self):
     # IMPORTANT:  The YAML Path is only lazily parsed!  This means parsing
     # ONLY happens when the path is in some way used.  Casting it to string
     # qualifies as one form of use, so this test will instigate parsing via
     # stringification.  THIS MATTERS WHEN YOUR INTENTION IS TO **CHANGE**
     # THE PATH SEPERATOR!  So, if an original path uses dot-notation and
     # you wish to change it to forward-slash-notation, you must first cause
     # the original to become parsed, AND THEN change the seperator.
     testpath = YAMLPath("abc.def")
     dotted = str(testpath)
     testpath.seperator = PathSeperators.FSLASH
     assert "/abc/def" == str(testpath) != dotted
Пример #2
0
 def test_seperator_change(self):
     dotted = "abc.def"
     slashed = "/abc/def"
     testpath = YAMLPath(dotted)
     testpath.seperator = PathSeperators.FSLASH
     assert slashed == str(testpath) != dotted