Beispiel #1
0
 def test_should_decode_simple_VCF_string(self):
     self.assertEqual('foo', decode_VCF_string('"foo"'))
Beispiel #2
0
 def test_should_fail_to_decode_string_with_unencoded_double_quote(self):
     with self.assertRaisesRegex(Exception, 'expected a VCF encoded string: \'"\""\''):
         print(decode_VCF_string('"\""'))
Beispiel #3
0
 def test_should_decode_empty_VCF_string(self):
     self.assertEqual('', decode_VCF_string('""'))
Beispiel #4
0
 def test_should_fail_to_decode_string_with_stray_backslash(self):
     with self.assertRaisesRegex(Exception, re.escape('expected a VCF encoded string: \'"\\\\"\'')):
         print(decode_VCF_string('"\\"'))
Beispiel #5
0
 def test_should_fail_to_decode_unquoted_string(self):
     with self.assertRaisesRegex(Exception, 'expected a VCF encoded string: \'foo\''):
         print(decode_VCF_string('foo'))
Beispiel #6
0
 def test_should_decode_complex_VCF_string(self):
     self.assertEqual(
         'abc\\def"ghi',
         decode_VCF_string('"abc\\\\def\\\"ghi"'))
Beispiel #7
0
 def test_should_decode_VCF_string_with_single_backslash(self):
     self.assertEqual('\\', decode_VCF_string('"\\\\"'))
Beispiel #8
0
 def test_should_decode_VCF_string_with_single_double_quote(self):
     self.assertEqual('"', decode_VCF_string('"\\""'))