def test_create_wrong_unit(self) -> None:
     parser = configparser.ConfigParser()
     parser.read_string(
         """
         [section]
         xpath=/valid
         url=nourl
         timeout=20
         unit=unknown
         """
     )
     with pytest.raises(ConfigurationError):
         XPathDelta.create("name", parser["section"])
Beispiel #2
0
 def test_create(self):
     parser = configparser.ConfigParser()
     parser.read_string('''[section]
                        xpath=/valid
                        url=nourl
                        timeout=20
                        unit=weeks''')
     check = XPathDelta.create('name', parser['section'])
     assert check._unit == 'weeks'
 def test_create(self) -> None:
     parser = configparser.ConfigParser()
     parser.read_string(
         """
         [section]
         xpath=/valid
         url=nourl
         timeout=20
         unit=weeks
         """
     )
     check = XPathDelta.create("name", parser["section"])
     assert check._unit == "weeks"