Beispiel #1
0
 def test_setbytes(self):
     conf = Config()
     conf.add_section("foo")
     conf.setbytes("foo", "bar", b"\xff\xff")
     assert conf.getbytes("foo", "bar") == b"\xff\xff"
Beispiel #2
0
 def test_stringlist_invalid_encoding(self):
     conf = Config()
     conf.add_section("foo")
     conf.setbytes("foo", "bar", b"\xff\xff\xff\xff\xff\xff")
     if PY2:
         self.assertRaises(Error, conf.getstringlist, "foo", "bar")
 def test_setbytes(self):
     conf = Config()
     conf.add_section("foo")
     conf.setbytes("foo", "bar", b"\xff\xff")
     assert conf.getbytes("foo", "bar") == b"\xff\xff"
Beispiel #4
0
 def test_stringlist_invalid_encoding(self):
     conf = Config()
     conf.add_section("foo")
     conf.setbytes("foo", "bar", b"\xff\xff\xff\xff\xff\xff")
 def test_stringlist_invalid_encoding(self):
     conf = Config()
     conf.add_section("foo")
     conf.setbytes("foo", "bar", b"\xff\xff\xff\xff\xff\xff")
     if PY2:
         self.assertRaises(Error, conf.getstringlist, "foo", "bar")