Ejemplo n.º 1
0
    def test_no_description_file(self):
        uploaded_file = self.make_uploaded_file()
        tempd = self.make_temp_dir()
        metad = {'name': 'proj', 'version': '1.1'}
        fk.unpack_project(uploaded_file, metad, tempd)

        self.assert_not_exists('proj/description.txt')
Ejemplo n.º 2
0
    def test_no_description_file(self):
        uploaded_file = self.make_uploaded_file()
        tempd = self.make_temp_dir()
        metad = {'name': 'proj', 'version': '1.1'}
        fk.unpack_project(uploaded_file, metad, tempd)

        self.assert_not_exists('proj/description.txt')
Ejemplo n.º 3
0
    def test_ensure_description_file(self):
        uploaded_file = self.make_uploaded_file()
        tempd = self.make_temp_dir()
        metad = {'name': 'proj', 'version': '1.1', 'description': 'descr'}
        fk.unpack_project(uploaded_file, metad, tempd)

        self.assert_contains('proj/description.txt', metad['description'])
Ejemplo n.º 4
0
    def test_ensure_description_file(self):
        uploaded_file = self.make_uploaded_file()
        tempd = self.make_temp_dir()
        metad = {'name': 'proj', 'version': '1.1', 'description': 'descr'}
        fk.unpack_project(uploaded_file, metad, tempd)

        self.assert_contains('proj/description.txt', metad['description'])
Ejemplo n.º 5
0
    def do_unpacks(self, uploaded_file):
        tempd = self.make_temp_dir()
        metad = {'name': 'proj', 'version': '1.1', 'description': 'descr'}
        fk.unpack_project(uploaded_file, metad, tempd)

        self.assert_exists('proj')
        self.assert_exists('proj/1.1')
        self.assert_exists('proj/1.1/index.html', exists=os.path.isfile)
        self.assert_exists('proj/description.txt', exists=os.path.isfile)
Ejemplo n.º 6
0
    def do_unpacks(self, uploaded_file):
        tempd = self.make_temp_dir()
        metad = {'name': 'proj', 'version': '1.1', 'description': 'descr'}
        fk.unpack_project(uploaded_file, metad, tempd)

        self.assert_exists('proj')
        self.assert_exists('proj/1.1')
        self.assert_exists('proj/1.1/index.html', exists=os.path.isfile)
        self.assert_exists('proj/description.txt', exists=os.path.isfile)
Ejemplo n.º 7
0
    def test_unpacks(self):
        tempd = tempfile.mkdtemp("hostthedocs_tests")
        self.addCleanup(shutil.rmtree, tempd)
        metad = {"name": "proj", "version": "1.1", "description": "descr"}
        fk.unpack_project(ZIPFILE, metad, tempd)

        def assert_exists(tail, exists=os.path.isdir):
            path = os.path.join(tempd, tail)
            self.assertTrue(exists(path), "%s does not exist" % path)

        assert_exists("proj")
        assert_exists("proj/1.1")
        assert_exists("proj/1.1/index.html", os.path.isfile)
        assert_exists("proj/description.txt", os.path.isfile)
Ejemplo n.º 8
0
    def do_unpacks(self, uploaded_file):
        tempd = tempfile.mkdtemp('hostthedocs_tests')
        self.addCleanup(shutil.rmtree, tempd)
        metad = {'name': 'proj', 'version': '1.1', 'description': 'descr'}
        fk.unpack_project(uploaded_file, metad, tempd)

        def assert_exists(tail, exists=os.path.isdir):
            path = os.path.join(tempd, tail)
            self.assertTrue(exists(path), '%s does not exist' % path)

        assert_exists('proj')
        assert_exists('proj/1.1')
        assert_exists('proj/1.1/index.html', os.path.isfile)
        assert_exists('proj/description.txt', os.path.isfile)