def testSpecial(self): os.chmod(self.tmpdir, 0o2755) store = Store(self.tmpdir) with open('HelloWorld.tgz', 'rb') as stream: store.add_archive_to_cache( 'sha1=3ce644dc725f1d21cfcf02562c76f375944b266a', stream, 'http://foo/foo.tgz')
def testSpecial(self): os.chmod(self.tmpdir, 0o2755) store = Store(self.tmpdir) with open('HelloWorld.tgz', 'rb') as stream: store.add_archive_to_cache('sha1=3ce644dc725f1d21cfcf02562c76f375944b266a', stream, 'http://foo/foo.tgz')
def testBad(self): logging.getLogger('').setLevel(logging.ERROR) store = Store(self.tmpdir) try: store.add_archive_to_cache('sha1=3ce644dc725f1d21cfcf02562c76f375944b266b', open('HelloWorld.tgz'), 'http://foo/foo.tgz') assert 0 except BadDigest: pass logging.getLogger('').setLevel(logging.INFO)
def testBad(self): logging.getLogger('').setLevel(logging.ERROR) store = Store(self.tmpdir) try: store.add_archive_to_cache( 'sha1=3ce644dc725f1d21cfcf02562c76f375944b266b', file('HelloWorld.tgz'), 'http://foo/foo.tgz') assert 0 except BadDigest: pass logging.getLogger('').setLevel(logging.INFO)
def testBad(self): logging.getLogger("").setLevel(logging.ERROR) store = Store(self.tmpdir) try: with open("HelloWorld.tgz", "rb") as stream: store.add_archive_to_cache( "sha1=3ce644dc725f1d21cfcf02562c76f375944b266b", stream, "http://foo/foo.tgz" ) assert 0 except BadDigest: pass logging.getLogger("").setLevel(logging.INFO)
def testSpecial(self): os.chmod(self.tmpdir, 0o2755) store = Store(self.tmpdir) with open("HelloWorld.tgz", "rb") as stream: store.add_archive_to_cache("sha1=3ce644dc725f1d21cfcf02562c76f375944b266a", stream, "http://foo/foo.tgz")
def testSpecial(self): os.chmod(self.tmpdir, 02755) store = Store(self.tmpdir) store.add_archive_to_cache( "sha1=3ce644dc725f1d21cfcf02562c76f375944b266a", file("HelloWorld.tgz"), "http://foo/foo.tgz" )