class TestWhenMultipleFakesMountPoints(unittest.TestCase):
    def setUp(self):
        self.ismount = FakeIsMount(['/vol1', '/vol2'])

    def test_recognize_both(self):
        assert self.ismount.is_mount('/vol1')
        assert self.ismount.is_mount('/vol2')
        assert not self.ismount.is_mount('/other')
class WhenMultipleFakesMountPoints:
    def setUp(self):
        self.ismount = FakeIsMount()
        self.ismount.add_mount('/vol1')
        self.ismount.add_mount('/vol2')

    @istest
    def recognize_both(self):
        assert_true(self.ismount('/vol1'))
        assert_true(self.ismount('/vol2'))
        assert_false(self.ismount('/other'))
Beispiel #3
0
class WhenMultipleFakesMountPoints:
    def setUp(self):
        self.ismount = FakeIsMount()
        self.ismount.add_mount('/vol1')
        self.ismount.add_mount('/vol2')

    @istest
    def recognize_both(self):
        assert_true(self.ismount('/vol1'))
        assert_true(self.ismount('/vol2'))
        assert_false(self.ismount('/other'))
class TestOnDefault(unittest.TestCase):
    def setUp(self):
        self.ismount = FakeIsMount([])

    def test_by_default_root_is_mount(self):

        assert self.ismount.is_mount('/')

    def test_while_by_default_any_other_is_not_a_mount_point(self):

        assert not self.ismount.is_mount('/any/other')
class WhenOneFakeVolumeIsDefined(unittest.TestCase):
    def setUp(self):
        self.ismount = FakeIsMount(['/fake-vol'])

    def test_accept_fake_mount_point(self):

        assert self.ismount.is_mount('/fake-vol')

    def test_other_still_are_not_mounts(self):

        assert not self.ismount.is_mount('/other')

    def test_dont_get_confused_by_traling_slash(self):

        assert self.ismount.is_mount('/fake-vol/')
Beispiel #6
0
class WhenOneFakeVolumeIsDefined:
    def setUp(self):
        self.ismount = FakeIsMount()
        self.ismount.add_mount('/fake-vol')

    @istest
    def accept_fake_mount_point(self):

        assert_true(self.ismount('/fake-vol'))

    @istest
    def other_still_are_not_mounts(self):

        assert_false(self.ismount('/other'))

    @istest
    def dont_get_confused_by_traling_slash(self):

        assert_true(self.ismount('/fake-vol/'))
class WhenOneFakeVolumeIsDefined:
    def setUp(self):
        self.ismount = FakeIsMount()
        self.ismount.add_mount('/fake-vol')

    @istest
    def accept_fake_mount_point(self):

        assert_true(self.ismount('/fake-vol'))

    @istest
    def other_still_are_not_mounts(self):

        assert_false(self.ismount('/other'))

    @istest
    def dont_get_confused_by_traling_slash(self):

        assert_true(self.ismount('/fake-vol/'))
Beispiel #8
0
class TestVolumeOf(unittest.TestCase):
    def setUp(self):
        self.ismount = FakeIsMount()
        self.volume_of = VolumeOf(self.ismount, os.path.normpath)

    def test_return_the_containing_volume(self):
        self.ismount.add_mount('/fake-vol')
        assert '/fake-vol' == self.volume_of('/fake-vol/foo')

    def test_with_file_that_are_outside(self):
        self.ismount.add_mount('/fake-vol')
        assert '/' == self.volume_of('/foo')

    def test_it_work_also_with_relative_mount_point(self):
        self.ismount.add_mount('relative-fake-vol')
        assert 'relative-fake-vol' == self.volume_of('relative-fake-vol/foo')
Beispiel #9
0
class TestVolumeOf:
    def setUp(self):
        self.ismount = FakeIsMount()
        self.volume_of = VolumeOf(self.ismount, os.path.normpath)

    @istest
    def return_the_containing_volume(self):
        self.ismount.add_mount('/fake-vol')
        assert_equal('/fake-vol', self.volume_of('/fake-vol/foo'))

    @istest
    def with_file_that_are_outside(self):
        self.ismount.add_mount('/fake-vol')
        assert_equal('/', self.volume_of('/foo'))

    @istest
    def it_work_also_with_relative_mount_point(self):
        self.ismount.add_mount('relative-fake-vol')
        assert_equal('relative-fake-vol',
                     self.volume_of('relative-fake-vol/foo'))
Beispiel #10
0
class TestVolumeOf:

    def setUp(self):
        self.ismount = FakeIsMount()
        self.volume_of = VolumeOf(ismount = self.ismount)
        self.volume_of.abspath = os.path.normpath

    @istest
    def return_the_containing_volume(self):
        self.ismount.add_mount('/fake-vol')
        assert_equals('/fake-vol', self.volume_of('/fake-vol/foo'))

    @istest
    def with_file_that_are_outside(self):
        self.ismount.add_mount('/fake-vol')
        assert_equals('/', self.volume_of('/foo'))

    @istest
    def it_work_also_with_relative_mount_point(self):
        self.ismount.add_mount('relative-fake-vol')
        assert_equals('relative-fake-vol', self.volume_of('relative-fake-vol/foo'))
 def setUp(self):
     self.ismount = FakeIsMount(['/vol1', '/vol2'])
Beispiel #12
0
 def setUp(self):
     self.ismount = FakeIsMount()
     self.ismount.add_mount('/fake-vol')
Beispiel #13
0
 def setUp(self):
     self.ismount = FakeIsMount()
     self.volume_of = VolumeOf(ismount = self.ismount)
     self.volume_of.abspath = os.path.normpath
def test_should_handle_relative_volumes():
    ismount = FakeIsMount()
    ismount.add_mount('fake-vol')
    assert ismount('fake-vol')
 def setUp(self):
     self.ismount = FakeIsMount()
 def setUp(self):
     self.ismount = FakeIsMount()
     self.ismount.add_mount('/vol1')
     self.ismount.add_mount('/vol2')
 def setUp(self):
     self.ismount = FakeIsMount(['/fake-vol'])
def test_should_handle_relative_volumes():
    ismount = FakeIsMount(['fake-vol'])
    assert ismount.is_mount('fake-vol')
Beispiel #19
0
 def setUp(self):
     self.ismount = FakeIsMount()
     self.ismount.add_mount('/vol1')
     self.ismount.add_mount('/vol2')
Beispiel #20
0
 def setUp(self):
     self.ismount = FakeIsMount()
     self.volume_of = VolumeOf(ismount=self.ismount)
     self.volume_of.abspath = os.path.normpath
Beispiel #21
0
def should_handle_relative_volumes():
    ismount = FakeIsMount()
    ismount.add_mount('fake-vol')
    assert_true(ismount('fake-vol'))
def should_handle_relative_volumes():
    ismount = FakeIsMount()
    ismount.add_mount('fake-vol')
    assert_true(ismount('fake-vol'))
Beispiel #23
0
 def setUp(self):
     self.ismount = FakeIsMount()
     self.volume_of = VolumeOf(self.ismount, os.path.normpath)
 def setUp(self):
     self.ismount = FakeIsMount()
     self.ismount.add_mount('/fake-vol')