<s> import os . path <EOL> import importlib <EOL> import unittest <EOL> tests_dir = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> package_name = tests_dir . split ( os . path . sep ) [ - <NUM_LIT:2> ] . replace ( '<STR_LIT:->' , '<STR_LIT:_>' ) <EOL> package = importlib . import_module ( package_name ) <EOL> class VersioningTestCase ( unittest . TestCase ) : <EOL> def assert_proper_attribute ( self , attribute ) : <EOL> try : <EOL> assert getattr ( package , attribute ) , ( <EOL> "<STR_LIT>" . format ( attribute ) ) <EOL> except AttributeError : <EOL> assert False , "<STR_LIT>" . format ( attribute ) <EOL> def test_version_attribute ( self ) : <EOL> self . assert_proper_attribute ( "<STR_LIT>" ) <EOL> version_split = package . __version__ . split ( "<STR_LIT:.>" ) [ : <NUM_LIT:3> ] <EOL> assert version_split , "<STR_LIT>" <EOL> for n in version_split : <EOL> try : <EOL> int ( n ) <EOL> except ValueError : <EOL> assert False , "<STR_LIT>" . format ( n ) <EOL> def test_commit_attribute ( self ) : <EOL> self . assert_proper_attribute ( "<STR_LIT>" ) <EOL> def test_build_attribute ( self ) : <EOL> self . assert_proper_attribute ( "<STR_LIT>" ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
