<s> import unittest <EOL> from lib . doi import DOI <EOL> class TestDOI ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . valid_doi = "<STR_LIT>" <EOL> self . valid_doi_with_protocol = "<STR_LIT>" <EOL> self . invalid_doi = "<STR_LIT>" <EOL> self . valid_doi_organization = "<STR_LIT>" <EOL> def test_set_identifier_on_creation ( self ) : <EOL> try : <EOL> doi = DOI ( self . valid_doi ) <EOL> doi = DOI ( self . valid_doi_organization ) <EOL> except Exception : <EOL> self . fail ( "<STR_LIT>" ) <EOL> def test_set_no_identifier_on_creation ( self ) : <EOL> try : <EOL> doi = DOI ( ) <EOL> except Exception : <EOL> self . fail ( "<STR_LIT>" ) <EOL> def test_set_invalid_identifier_on_creation ( self ) : <EOL> self . assertRaises ( ValueError , DOI , self . invalid_doi ) <EOL> def test_query_url_of_undefined_doi_object ( self ) : <EOL> doi = DOI ( ) <EOL> self . assertEqual ( doi . get_URL ( ) , None ) <EOL> def test_query_url_of_undefined_doi_object ( self ) : <EOL> doi = DOI ( ) <EOL> self . assertEqual ( doi . get_identifier ( ) , doi . UNKNOWN_IDENTIFIER ) <EOL> def test_query_url_of_doi_object ( self ) : <EOL> doi = DOI ( self . valid_doi ) <EOL> self . assertEqual ( doi . get_URL ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( doi . get_identifier ( ) , "<STR_LIT>" ) <EOL> def test_query_url_of_doi_object_with_protocol ( self ) : <EOL> doi = DOI ( self . valid_doi_with_protocol ) <EOL> self . assertEqual ( doi . get_URL ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( doi . get_identifier ( ) , "<STR_LIT>" ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
