<s> from anvil import downloader <EOL> from anvil import exceptions <EOL> from anvil import test <EOL> class TestGitDownloader ( test . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( TestGitDownloader , self ) . setUp ( ) <EOL> self . _uri = '<STR_LIT>' <EOL> self . _dst = '<STR_LIT>' <EOL> self . _sha1 = '<STR_LIT>' <EOL> self . _tag = '<STR_LIT>' <EOL> def test_constructor_basic ( self ) : <EOL> d = downloader . GitDownloader ( self . _uri , self . _dst ) <EOL> self . assertEqual ( d . _uri , self . _uri ) <EOL> self . assertEqual ( d . _dst , self . _dst ) <EOL> self . assertEqual ( d . _branch , '<STR_LIT>' ) <EOL> self . assertEqual ( d . _tag , None ) <EOL> self . assertEqual ( d . _sha1 , None ) <EOL> def test_constructor_branch ( self ) : <EOL> branch = '<STR_LIT>' <EOL> d = downloader . GitDownloader ( self . _uri , self . _dst , branch = branch ) <EOL> self . assertEqual ( d . _branch , branch ) <EOL> self . assertEqual ( d . _tag , None ) <EOL> self . assertEqual ( d . _sha1 , None ) <EOL> def test_constructor_string_tag ( self ) : <EOL> d = downloader . GitDownloader ( self . _uri , self . _dst , tag = self . _tag ) <EOL> self . assertEqual ( d . _tag , self . _tag ) <EOL> self . assertEqual ( d . _sha1 , None ) <EOL> def test_constructor_float_tag ( self ) : <EOL> tag = <NUM_LIT> <EOL> d = downloader . GitDownloader ( self . _uri , self . _dst , tag = tag ) <EOL> self . assertEqual ( d . _tag , str ( tag ) ) <EOL> self . assertEqual ( d . _sha1 , None ) <EOL> def test_constructor_sha1 ( self ) : <EOL> d = downloader . GitDownloader ( self . _uri , self . _dst , sha1 = self . _sha1 ) <EOL> self . assertEqual ( d . _tag , None ) <EOL> self . assertEqual ( d . _sha1 , self . _sha1 ) <EOL> def test_constructor_raises_exception ( self ) : <EOL> kwargs = { "<STR_LIT>" : self . _tag , '<STR_LIT>' : self . _sha1 } <EOL> self . assertRaises ( exceptions . ConfigException , <EOL> downloader . GitDownloader , <EOL> self . _uri , self . _dst , ** kwargs ) </s>
