-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from samoylv/screen
Screen
- Loading branch information
Showing
9 changed files
with
249 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
:module: Top level test module for unittests in WPG. | ||
""" | ||
import unittest | ||
import sys | ||
|
||
# Import suites to run. | ||
from wpg_test.OpticalElementsTest import EmptyTest | ||
|
||
# Define the encapsulating test suite. | ||
def suite(): | ||
suites = [ | ||
unittest.makeSuite(EmptyTest, 'test'), | ||
] | ||
|
||
return unittest.TestSuite(suites) | ||
|
||
# Run the top level suite and return a success status code. This enables running an automated git-bisect. | ||
if __name__=="__main__": | ||
|
||
result = unittest.TextTestRunner(verbosity=2).run(suite()) | ||
|
||
if result.wasSuccessful(): | ||
print '---> OK <---' | ||
sys.exit(0) | ||
|
||
sys.exit(1) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
""" Test module for wpg.OpticalElements. | ||
:author : Carsten Fortmann-Grote | ||
:institution : European XFEL GmbH, Holzkoppel 4, 22869 Schenefeld, Germany | ||
:creation date: 20170329 | ||
""" | ||
import os, sys, shutil | ||
import unittest | ||
|
||
|
||
# Add sources to global namespace. | ||
sys.path.insert(0,os.path.abspath(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..','..'))) | ||
|
||
# Import the class to test. | ||
from wpg import optical_elements | ||
|
||
|
||
class EmptyTest(unittest.TestCase): | ||
""" | ||
Test class for the screen class. | ||
""" | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
""" Setting up the test class. """ | ||
pass | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
""" Tearing down the test class. """ | ||
pass | ||
|
||
def setUp(self): | ||
""" Setting up a test. """ | ||
self.__files_to_remove = [] | ||
self.__dirs_to_remove = [] | ||
|
||
def tearDown(self): | ||
""" Tearing down a test. """ | ||
|
||
for f in self.__files_to_remove: | ||
if os.path.isfile(f): os.remove(f) | ||
for d in self.__dirs_to_remove: | ||
if os.path.isdir(d): shutil.rmtree(d) | ||
|
||
def testDefaultConstruction(self): | ||
""" Testing the construction of an empty element.""" | ||
empty = optical_elements.Empty() | ||
|
||
# Check inheritance. | ||
self.assertIsInstance(empty, optical_elements.Empty) | ||
self.assertIsInstance(empty, optical_elements.WPGOpticalElement) | ||
self.assertIsInstance(empty, object) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
|
Empty file.
Oops, something went wrong.