Exemple #1
0
 def test_create_not_numeric(self):
     parser = configparser.ConfigParser()
     parser.read_string('''[section]
                        unit=seconds
                        value=asdfasd''')
     with pytest.raises(ConfigurationError):
         Periodic.create('name', parser['section'])
Exemple #2
0
 def test_create_wrong_unit(self):
     parser = configparser.ConfigParser()
     parser.read_string('''[section]
                        unit=asdfasdf
                        value=13''')
     with pytest.raises(ConfigurationError):
         Periodic.create('name', parser['section'])
 def test_create_float(self) -> None:
     parser = configparser.ConfigParser()
     parser.read_string(
         """
         [section]
         unit=seconds
         value=21312.12
         """
     )
     Periodic.create("name", parser["section"])
 def test_create_no_unit(self) -> None:
     parser = configparser.ConfigParser()
     parser.read_string(
         """
         [section]
         value=asdfasd
         """
     )
     with pytest.raises(ConfigurationError):
         Periodic.create("name", parser["section"])
Exemple #5
0
 def test_create(self):
     parser = configparser.ConfigParser()
     parser.read_string('''[section]
                        unit=seconds
                        value=13''')
     check = Periodic.create('name', parser['section'])
     assert check._delta == timedelta(seconds=13)
 def test_create(self) -> None:
     parser = configparser.ConfigParser()
     parser.read_string(
         """
         [section]
         unit=seconds
         value=13
         """
     )
     check = Periodic.create("name", parser["section"])
     assert check._delta == timedelta(seconds=13)
Exemple #7
0
 def test_create_float(self):
     parser = configparser.ConfigParser()
     parser.read_string('''[section]
                        unit=seconds
                        value=21312.12''')
     Periodic.create('name', parser['section'])