Skip to content
This repository has been archived by the owner on May 30, 2020. It is now read-only.

Commit

Permalink
Added more tests for min_value/max_value of low_temperature and high_…
Browse files Browse the repository at this point in the history
…temperature in Configuration
  • Loading branch information
ercpe committed Dec 24, 2015
1 parent 31e1a36 commit 3e91e99
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tests/fixtures/config/temperatures_high.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[GENERAL]
high_temperature = 100
low_temperature = 100
3 changes: 3 additions & 0 deletions tests/fixtures/config/temperatures_low.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[GENERAL]
high_temperature = 0
low_temperature = 0
16 changes: 13 additions & 3 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ def test_get_high_temperature_not_set(self):
cfg = Configuration('/dev/null')
assert cfg.high_temperature is None

def test_get_low_temperature_not_set(self):
cfg = Configuration('/dev/null')
assert cfg.low_temperature is None
def test_get_high_temperature_limited(self):
cfg1 = Configuration('tests/fixtures/config/temperatures_high.cfg')
assert cfg1.high_temperature is 30

cfg2 = Configuration('tests/fixtures/config/temperatures_low.cfg')
assert cfg2.high_temperature == 5

def test_get_low_temperature_limited(self):
cfg1 = Configuration('tests/fixtures/config/temperatures_high.cfg')
assert cfg1.low_temperature is 30

cfg2 = Configuration('tests/fixtures/config/temperatures_low.cfg')
assert cfg2.low_temperature == 5

0 comments on commit 3e91e99

Please sign in to comment.