Skip to content

Commit

Permalink
tests: do not check the opencv command if it wasn't installed (#1431)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Arias authored Jul 31, 2017
1 parent e54066e commit 6c5c0a2
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions snaps_tests/demos_tests/test_opencv.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ class OpenCVTestCase(snaps_tests.SnapsTestCase):
def test_opencv(self):
snap_path = self.build_snap(self.snap_content_dir)
self.install_snap(snap_path, 'opencv-example', '1.0')
output = self.run_command_in_snappy_testbed(
'/snap/bin/opencv-example.example').splitlines()
if not snaps_tests.config.get('skip-install', False):
output = self.run_command_in_snappy_testbed(
'/snap/bin/opencv-example.example').splitlines()

# Depending on opencv the result is now displayed differently
# so let's do a lazy match.
# On artful you see:
# [ 1, 3;
# 2, 4]
# And on others:
# [1, 3;
# 2, 4]
expected_in_first_line = ['[', '1', ',', '3', ';']
self.assertThat(output[0], ContainsAll(expected_in_first_line))
expected_in_second_line = ['2', ',', '4', ']']
self.assertThat(output[1], ContainsAll(expected_in_second_line))
# Depending on opencv the result is now displayed differently
# so let's do a lazy match.
# On artful you see:
# [ 1, 3;
# 2, 4]
# And on others:
# [1, 3;
# 2, 4]
expected_in_first_line = ['[', '1', ',', '3', ';']
self.assertThat(output[0], ContainsAll(expected_in_first_line))
expected_in_second_line = ['2', ',', '4', ']']
self.assertThat(output[1], ContainsAll(expected_in_second_line))

0 comments on commit 6c5c0a2

Please sign in to comment.