diff options
author | Prashanth Pai <ppai@redhat.com> | 2016-08-10 15:28:48 +0530 |
---|---|---|
committer | Prashanth Pai <ppai@redhat.com> | 2016-08-10 18:20:57 +0530 |
commit | 655b0d2793386d2059b9c682e931035a83619917 (patch) | |
tree | c1dfcc19202af123b649767c6a0bb5c4b340bd63 /test | |
parent | d4b8804abb876bda9803cee61c6c4298b475e6be (diff) |
Move source files into gfapi/ dir
Currently, many source files are directly placed under gluster/ dir:
gluster/exceptions.py
gluster/gfapi.py
gluster/utils.py
When multiple packages (RPMs) are sharing the same gluster namespace,
these source files will conflict if there are source files with same
names provided by other projects.
Fix: Move all source files in gluster/* to gluster/gfapi/*
Note that this patch does not break how existing users import gfapi.
Change-Id: Idf9d07eefafe8333215d6c61201c97c982565ba9
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/libgfapi-python-tests.py | 4 | ||||
-rw-r--r-- | test/unit/gluster/test_gfapi.py | 14 | ||||
-rw-r--r-- | test/unit/gluster/test_utils.py | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/test/functional/libgfapi-python-tests.py b/test/functional/libgfapi-python-tests.py index 8c62685..cf269d3 100644 --- a/test/functional/libgfapi-python-tests.py +++ b/test/functional/libgfapi-python-tests.py @@ -19,9 +19,9 @@ from test import get_test_config from ConfigParser import NoSectionError, NoOptionError from uuid import uuid4 -from gluster.api import Stat +from gluster.gfapi.api import Stat from gluster.gfapi import File, Volume, DirEntry -from gluster.exceptions import LibgfapiException, Error +from gluster.gfapi.exceptions import LibgfapiException, Error config = get_test_config() if config: diff --git a/test/unit/gluster/test_gfapi.py b/test/unit/gluster/test_gfapi.py index 15ce061..4b58597 100644 --- a/test/unit/gluster/test_gfapi.py +++ b/test/unit/gluster/test_gfapi.py @@ -18,8 +18,8 @@ import math import errno from gluster.gfapi import File, Dir, Volume, DirEntry -from gluster import api -from gluster.exceptions import LibgfapiException +from gluster.gfapi import api +from gluster.gfapi.exceptions import LibgfapiException from nose import SkipTest from mock import Mock, MagicMock, patch from contextlib import nested @@ -483,7 +483,7 @@ class TestVolume(unittest.TestCase): mock_glfs_creat = Mock() mock_glfs_creat.return_value = 2 - with patch("gluster.api.glfs_creat", mock_glfs_creat): + with patch("gluster.gfapi.api.glfs_creat", mock_glfs_creat): with File(self.vol.open("file.txt", os.O_CREAT, 0644)) as f: self.assertTrue(isinstance(f, File)) self.assertEqual(mock_glfs_creat.call_count, 1) @@ -849,7 +849,7 @@ class TestVolume(unittest.TestCase): mock_glfs_open = Mock() mock_glfs_open.return_value = 2 - with patch("gluster.api.glfs_open", mock_glfs_open): + with patch("gluster.gfapi.api.glfs_open", mock_glfs_open): with File(self.vol.open("file.txt", os.O_WRONLY)) as f: self.assertTrue(isinstance(f, File)) self.assertEqual(mock_glfs_open.call_count, 1) @@ -864,14 +864,14 @@ class TestVolume(unittest.TestCase): with self.vol.open("file.txt", os.O_WRONLY) as fd: self.assertEqual(fd, None) - with patch("gluster.api.glfs_open", mock_glfs_open): + with patch("gluster.gfapi.api.glfs_open", mock_glfs_open): self.assertRaises(OSError, assert_open) def test_open_direct_success(self): mock_glfs_open = Mock() mock_glfs_open.return_value = 2 - with patch("gluster.api.glfs_open", mock_glfs_open): + with patch("gluster.gfapi.api.glfs_open", mock_glfs_open): f = File(self.vol.open("file.txt", os.O_WRONLY)) self.assertTrue(isinstance(f, File)) self.assertEqual(mock_glfs_open.call_count, 1) @@ -882,7 +882,7 @@ class TestVolume(unittest.TestCase): mock_glfs_open = Mock() mock_glfs_open.return_value = None - with patch("gluster.api.glfs_open", mock_glfs_open): + with patch("gluster.gfapi.api.glfs_open", mock_glfs_open): self.assertRaises(OSError, self.vol.open, "file.txt", os.O_RDONLY) def test_opendir_success(self): diff --git a/test/unit/gluster/test_utils.py b/test/unit/gluster/test_utils.py index 446bcd9..e58e225 100644 --- a/test/unit/gluster/test_utils.py +++ b/test/unit/gluster/test_utils.py @@ -10,8 +10,8 @@ import unittest -from gluster import utils -from gluster.exceptions import VolumeNotMounted +from gluster.gfapi import utils +from gluster.gfapi.exceptions import VolumeNotMounted class TestUtils(unittest.TestCase): |