Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gnome-battery-bench
Commits
c5ea2b0e
Commit
c5ea2b0e
authored
Apr 03, 2017
by
Christian Kellner
Browse files
integration-test: test for charge based reporting
parent
c0cce11e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/integration-test
View file @
c5ea2b0e
...
...
@@ -257,6 +257,32 @@ class Tests(unittest.TestCase):
log.close()
self.gbb_stop()
def test_charge_basic(self):
self.add_std_platform()
self.testbed.add_device('
power_supply
', '
BAT0
', None,
['
type
', '
Battery
',
'
manufacturer
', '
GNOME
.
org
',
'
model_name
', '
b1
',
'
present
', '
1
',
'
status
', '
Discharging
',
'
charge_full
', '
7226000
',
'
charge_full_design
', '
7150000
',
'
charge_now
', '
4234000
',
'
voltage_min_design
', '
7600000
'], [])
log = self.gbb("info", ["--json"])
out = json.loads(log)
self.assertTrue('
hardware
' in out)
hw = out['
hardware
']
self.assertTrue('
batteries
' in hw)
bats = hw['
batteries
']
self.assertEqual(len(bats), 1)
b1 = bats[0]
self.assertEqual(b1['
voltage
-
design
'], 7.6)
self.assertEqual(b1['
energy
-
full
'], 54.9176)
self.assertEqual(b1['
energy
-
full
-
design
'], 54.34)
if __name__ == '
__main__
':
if '
umockdev
' not in os.environ.get('
LD_PRELOAD
', ''):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment