Beispiel #1
0
    def test_unit__folder_label_reserved_with_case__ok__folder_at_root(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()

        ok_(
            not integrity_manager.content_label_is_free(
                content_label_as_file='W1F1',
                workspace=w1,
                parent=None,
            ),
            msg='label W1F1 should be reserved',
        )
Beispiel #2
0
    def test_unit__folder_label_reserved_with_case__ok__folder_at_root(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()

        ok_(
            not integrity_manager.content_label_is_free(
                content_label_as_file='W1F1',
                workspace=w1,
                parent=None,
            ),
            msg='label W1F1 should be reserved',
        )
Beispiel #3
0
    def test_unit__folder_label_available__ok__folder_at_root(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()

        ok_(
            integrity_manager.content_label_is_free(
                content_label_as_file='f42',
                workspace=w1,
                parent=None,
            ),
            msg='label f42 should not be used',
        )
Beispiel #4
0
    def test_unit__folder_label_available__ok__folder_at_root(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()

        ok_(
            integrity_manager.content_label_is_free(
                content_label_as_file='f42',
                workspace=w1,
                parent=None,
            ),
            msg='label f42 should not be used',
        )
Beispiel #5
0
    def test_unit__folder_label_reserved__ok__folder_in_folder(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()
        w1f1 = self._get_content_by_label('w1f1')

        ok_(
            not integrity_manager.content_label_is_free(
                content_label_as_file='w1f1f1',
                workspace=w1,
                parent=w1f1,
            ),
            msg='label w1f1f1 should be reserved',
        )
Beispiel #6
0
    def test_unit__content_label_available__ok__without_extension(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()
        w1f1 = self._get_content_by_label('w1f1')

        ok_(
            integrity_manager.content_label_is_free(
                content_label_as_file='w1f1p42',
                workspace=w1,
                parent=w1f1,
            ),
            msg='label w1f1p42 should be available',
        )
Beispiel #7
0
    def test_unit__folder_label_reserved__ok__folder_in_folder(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()
        w1f1 = self._get_content_by_label('w1f1')

        ok_(
            not integrity_manager.content_label_is_free(
                content_label_as_file='w1f1f1',
                workspace=w1,
                parent=w1f1,
            ),
            msg='label w1f1f1 should be reserved',
        )
Beispiel #8
0
    def test_unit__content_label_available__ok__without_extension(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()
        w1f1 = self._get_content_by_label('w1f1')

        ok_(
            integrity_manager.content_label_is_free(
                content_label_as_file='w1f1p42',
                workspace=w1,
                parent=w1f1,
            ),
            msg='label w1f1p42 should be available',
        )
Beispiel #9
0
    def test_unit__content_label_reserved__ok__because_page_name(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()
        w1f1 = self._get_content_by_label('w1f1')

        ok_(
            not integrity_manager.content_label_is_free(
                content_label_as_file='w1f1p1.html',
                workspace=w1,
                parent=w1f1,
            ),
            msg='label w1f1p1.html should be reserved '
                'because page w1f1p1.html',
        )
Beispiel #10
0
    def test_unit__content_label_reserved__ok__because_thread_extension(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()
        w1f1 = self._get_content_by_label('w1f1')

        ok_(
            not integrity_manager.content_label_is_free(
                content_label_as_file='w1f1t1.html',
                workspace=w1,
                parent=w1f1,
            ),
            msg='label w1f1t1 should be reserved because '
                'w1f1t1 rendered with .html',
        )
Beispiel #11
0
    def test_unit__content_label_reserved__ok__because_page_name(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()
        w1f1 = self._get_content_by_label('w1f1')

        ok_(
            not integrity_manager.content_label_is_free(
                content_label_as_file='w1f1p1.html',
                workspace=w1,
                parent=w1f1,
            ),
            msg='label w1f1p1.html should be reserved '
            'because page w1f1p1.html',
        )
Beispiel #12
0
    def test_unit__content_label_reserved__ok__because_thread_extension(self):
        integrity_manager = PathValidationManager()
        w1 = DBSession.query(Workspace).filter(Workspace.label == 'w1').one()
        w1f1 = self._get_content_by_label('w1f1')

        ok_(
            not integrity_manager.content_label_is_free(
                content_label_as_file='w1f1t1.html',
                workspace=w1,
                parent=w1f1,
            ),
            msg='label w1f1t1 should be reserved because '
            'w1f1t1 rendered with .html',
        )