Merge lp:~jeffmarcom/opencompute/unit_test_cleanup into lp:opencompute/checkbox

Proposed by Jeff Marcom
Status: Merged
Approved by: Jeff Lane 
Approved revision: 2143
Merged at revision: 2144
Proposed branch: lp:~jeffmarcom/opencompute/unit_test_cleanup
Merge into: lp:opencompute/checkbox
Diff against target: 86 lines (+0/-82)
1 file modified
test_scripts/tests/test_gputest_benchmark.py (+0/-82)
To merge this branch: bzr merge lp:~jeffmarcom/opencompute/unit_test_cleanup
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+180957@code.launchpad.net

Commit message

Removed gpu_benchmark_test test script

Description of the change

This removes the gpu_benchmark_test test script from ocp-checkbox so that we can continue to use the unittest feature without error.

To post a comment you must log in.
Revision history for this message
Jeff Lane  (bladernr) wrote :

Looks good, thanks for further cleanup

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'test_scripts/tests/test_gputest_benchmark.py'
2--- test_scripts/tests/test_gputest_benchmark.py 2013-04-16 08:09:40 +0000
3+++ test_scripts/tests/test_gputest_benchmark.py 1970-01-01 00:00:00 +0000
4@@ -1,82 +0,0 @@
5-#
6-# This file is part of Checkbox.
7-#
8-# Copyright 2013 Canonical Ltd.
9-#
10-# Checkbox is free software: you can redistribute it and/or modify
11-# it under the terms of the GNU General Public License as published by
12-# the Free Software Foundation, either version 3 of the License, or
13-# (at your option) any later version.
14-#
15-# Checkbox is distributed in the hope that it will be useful,
16-# but WITHOUT ANY WARRANTY; without even the implied warranty of
17-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18-# GNU General Public License for more details.
19-#
20-# You should have received a copy of the GNU General Public License
21-# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
22-#
23-import imp
24-import os
25-import unittest
26-
27-from mock import patch
28-from tempfile import NamedTemporaryFile
29-
30-imp.load_source('gputest_benchmark', os.path.join(os.path.dirname(__file__),
31- '..', '..', 'scripts', 'gputest_benchmark'))
32-from gputest_benchmark import check_log
33-
34-
35-class LogParserTest(unittest.TestCase):
36-
37- def setUp(self):
38- self.logfile = NamedTemporaryFile(delete=False)
39- self.devnull = open(os.devnull, 'w')
40-
41- def test_logfile_not_found(self):
42- os.unlink(self.logfile.name)
43- with self.assertRaises(SystemExit) as cm:
44- check_log(self.logfile.name)
45- self.assertEqual(
46- "[Errno 2] No such file or directory: "
47- "'{}'".format(self.logfile.name),
48- str(cm.exception))
49-
50- def test_logfile_with_score(self):
51- with open(self.logfile.name, 'wt') as f:
52- f.write('FurMark : init OK.\n')
53- f.write('[Benchmark_Score] - module: FurMark - Score: 8 points'
54- '(800x600 windowed, duration:2000 ms).')
55- with patch('sys.stdout', self.devnull):
56- self.assertFalse(check_log(self.logfile.name))
57- os.unlink(self.logfile.name)
58-
59- def test_logfile_without_score(self):
60- with open(self.logfile.name, 'wt') as f:
61- f.write('FurMark : init OK.\n')
62- f.write('[No_Score] - module: FurMark - Score: _ points'
63- '(800x600 windowed, duration:2000 ms).')
64- with patch('sys.stdout', self.devnull):
65- with self.assertRaises(SystemExit) as cm:
66- check_log(self.logfile.name)
67- self.assertEqual(
68- 'Benchmark score not found, check the log for errors',
69- str(cm.exception))
70- os.unlink(self.logfile.name)
71-
72- def test_logfile_with_encoding_error(self):
73- with open(self.logfile.name, 'wb') as f:
74- f.write(b'\x80abc\n')
75- f.write(b'FurMark : init OK.\n')
76- f.write(b'[Benchmark_Score] - module: FurMark - Score: 116 points'
77- b'(800x600 windowed, duration:2000 ms).')
78- with patch('sys.stdout', self.devnull):
79- self.assertFalse(check_log(self.logfile.name))
80- os.unlink(self.logfile.name)
81-
82- def tearDown(self):
83- try:
84- os.unlink(self.logfile.name)
85- except OSError:
86- pass

Subscribers

People subscribed via source and target branches