Ejemplo n.º 1
0
 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')
Ejemplo n.º 2
0
	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')
Ejemplo n.º 3
0
	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)
Ejemplo n.º 4
0
    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)
Ejemplo n.º 5
0
    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)
Ejemplo n.º 6
0
 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")
Ejemplo n.º 7
0
 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"
     )