Beispiel #1
0
    def test_convert_volume_binds_unicode_unicode_input(self):
        if six.PY2:
            expected = [unicode('/mnt/지연:/unicode/박:rw', 'utf-8')]

            data = {
                unicode('/mnt/지연', 'utf-8'): {
                    'bind': unicode('/unicode/박', 'utf-8'),
                    'mode': 'rw'
                }
            }
            self.assertEqual(
                convert_volume_binds(data), expected
            )
        else:
            expected = ['/mnt/지연:/unicode/박:rw']

            data = {
                '/mnt/지연': {
                    'bind': '/unicode/박',
                    'mode': 'rw'
                }
            }
            self.assertEqual(
                convert_volume_binds(data), expected
            )
Beispiel #2
0
    def test_convert_volume_binds_unicode_unicode_input(self):
        if six.PY2:
            expected = [unicode('/mnt/지연:/unicode/박:rw', 'utf-8')]

            data = {
                unicode('/mnt/지연', 'utf-8'): {
                    'bind': unicode('/unicode/박', 'utf-8'),
                    'mode': 'rw'
                }
            }
            self.assertEqual(
                convert_volume_binds(data), expected
            )
        else:
            expected = ['/mnt/지연:/unicode/박:rw']

            data = {
                '/mnt/지연': {
                    'bind': '/unicode/박',
                    'mode': 'rw'
                }
            }
            self.assertEqual(
                convert_volume_binds(data), expected
            )
Beispiel #3
0
    def test_convert_volume_binds_unicode_unicode_input(self):
        if six.PY2:
            expected = [unicode("/mnt/지연:/unicode/박:rw", "utf-8")]

            data = {unicode("/mnt/지연", "utf-8"): {"bind": unicode("/unicode/박", "utf-8"), "mode": "rw"}}
            self.assertEqual(convert_volume_binds(data), expected)
        else:
            expected = ["/mnt/지연:/unicode/박:rw"]

            data = {"/mnt/지연": {"bind": "/unicode/박", "mode": "rw"}}
            self.assertEqual(convert_volume_binds(data), expected)
Beispiel #4
0
 def test_convert_volume_binds_no_mode(self):
     data = {
         '/mnt/vol1': {
             'bind': '/data'
         }
     }
     assert convert_volume_binds(data) == ['/mnt/vol1:/data:rw']
Beispiel #5
0
 def test_convert_volume_binds_no_mode(self):
     data = {
         '/mnt/vol1': {
             'bind': '/data'
         }
     }
     assert convert_volume_binds(data) == ['/mnt/vol1:/data:rw']
Beispiel #6
0
 def test_convert_volume_binds_no_mode(self):
     data = {
         '/mnt/vol1': {
             'bind': '/data'
         }
     }
     self.assertEqual(convert_volume_binds(data), ['/mnt/vol1:/data:rw'])
Beispiel #7
0
 def test_convert_volume_binds_no_mode(self):
     data = {
         '/mnt/vol1': {
             'bind': '/data'
         }
     }
     self.assertEqual(convert_volume_binds(data), ['/mnt/vol1:/data:rw'])
Beispiel #8
0
 def test_convert_volume_binds_complete(self):
     data = {
         '/mnt/vol1': {
             'bind': '/data',
             'mode': 'ro'
         }
     }
     self.assertEqual(convert_volume_binds(data), ['/mnt/vol1:/data:ro'])
Beispiel #9
0
 def test_convert_volume_binds_complete(self):
     data = {
         '/mnt/vol1': {
             'bind': '/data',
             'mode': 'ro'
         }
     }
     assert convert_volume_binds(data) == ['/mnt/vol1:/data:ro']
Beispiel #10
0
 def test_convert_volume_binds_complete(self):
     data = {
         '/mnt/vol1': {
             'bind': '/data',
             'mode': 'ro'
         }
     }
     self.assertEqual(convert_volume_binds(data), ['/mnt/vol1:/data:ro'])
Beispiel #11
0
 def test_convert_volume_binds_complete(self):
     data = {
         '/mnt/vol1': {
             'bind': '/data',
             'mode': 'ro'
         }
     }
     assert convert_volume_binds(data) == ['/mnt/vol1:/data:ro']
Beispiel #12
0
    def test_convert_volume_binds_unicode_unicode_input(self):
        expected = [u'/mnt/지연:/unicode/박:rw']

        data = {
            u'/mnt/지연': {
                'bind': u'/unicode/박',
                'mode': 'rw'
            }
        }
        assert convert_volume_binds(data) == expected
Beispiel #13
0
    def test_convert_volume_binds_unicode_bytes_input(self):
        expected = [u'/mnt/지연:/unicode/박:rw']

        data = {
            u'/mnt/지연'.encode('utf-8'): {
                'bind': u'/unicode/박'.encode('utf-8'),
                'mode': 'rw'
            }
        }
        assert convert_volume_binds(data) == expected
Beispiel #14
0
    def test_convert_volume_binds_unicode_bytes_input(self):
        expected = [u'/mnt/지연:/unicode/박:rw']

        data = {
            u'/mnt/지연'.encode('utf-8'): {
                'bind': u'/unicode/박'.encode('utf-8'),
                'mode': 'rw'
            }
        }
        assert convert_volume_binds(data) == expected
Beispiel #15
0
    def test_convert_volume_binds_unicode_unicode_input(self):
        expected = [u'/mnt/지연:/unicode/박:rw']

        data = {
            u'/mnt/지연': {
                'bind': u'/unicode/박',
                'mode': 'rw'
            }
        }
        assert convert_volume_binds(data) == expected
Beispiel #16
0
 def test_convert_volume_binds_list(self):
     data = ['/a:/a:ro', '/b:/c:z']
     assert convert_volume_binds(data) == data
Beispiel #17
0
 def test_convert_volume_binds_empty(self):
     assert convert_volume_binds({}) == []
     assert convert_volume_binds([]) == []
Beispiel #18
0
 def test_convert_volume_binds_compact(self):
     data = {'/mnt/vol1': '/data'}
     self.assertEqual(convert_volume_binds(data), ['/mnt/vol1:/data:rw'])
Beispiel #19
0
 def test_convert_volume_binds_list(self):
     data = ['/a:/a:ro', '/b:/c:z']
     self.assertEqual(convert_volume_binds(data), data)
Beispiel #20
0
 def test_convert_volume_binds_empty(self):
     self.assertEqual(convert_volume_binds({}), [])
     self.assertEqual(convert_volume_binds([]), [])
Beispiel #21
0
 def test_convert_volume_binds_compact(self):
     data = {
         '/mnt/vol1': '/data'
     }
     assert convert_volume_binds(data) == ['/mnt/vol1:/data:rw']
Beispiel #22
0
 def test_convert_volume_binds_list(self):
     data = ['/a:/a:ro', '/b:/c:z']
     assert convert_volume_binds(data) == data
Beispiel #23
0
 def test_convert_volume_binds_list(self):
     data = ["/a:/a:ro", "/b:/c:z"]
     self.assertEqual(convert_volume_binds(data), data)
Beispiel #24
0
 def test_convert_volume_binds_list(self):
     data = ['/a:/a:ro', '/b:/c:z']
     self.assertEqual(convert_volume_binds(data), data)
Beispiel #25
0
 def test_convert_volume_binds_empty(self):
     self.assertEqual(convert_volume_binds({}), [])
     self.assertEqual(convert_volume_binds([]), [])
Beispiel #26
0
 def test_convert_volume_binds_complete(self):
     data = {"/mnt/vol1": {"bind": "/data", "mode": "ro"}}
     self.assertEqual(convert_volume_binds(data), ["/mnt/vol1:/data:ro"])
Beispiel #27
0
 def test_convert_volume_binds_compact(self):
     data = {"/mnt/vol1": "/data"}
     self.assertEqual(convert_volume_binds(data), ["/mnt/vol1:/data:rw"])
Beispiel #28
0
 def test_convert_volume_binds_compact(self):
     data = {'/mnt/vol1': '/data'}
     assert convert_volume_binds(data) == ['/mnt/vol1:/data:rw']
Beispiel #29
0
 def test_convert_volume_binds_compact(self):
     data = {
         '/mnt/vol1': '/data'
     }
     self.assertEqual(convert_volume_binds(data), ['/mnt/vol1:/data:rw'])
Beispiel #30
0
 def test_convert_volume_binds_empty(self):
     assert convert_volume_binds({}) == []
     assert convert_volume_binds([]) == []
Beispiel #31
0
 def test_convert_volume_binds_no_mode(self):
     data = {"/mnt/vol1": {"bind": "/data"}}
     self.assertEqual(convert_volume_binds(data), ["/mnt/vol1:/data:rw"])