コード例 #1
0
    def test_path_given_does_not_exist(self):
        path = tempfile.mkdtemp()
        os.rmdir(path)

        self.assertEqual(
            path, devappserver2._get_storage_path(path, 'example.com:myapp'))
        self.assertTrue(os.path.isdir(path))
コード例 #2
0
ファイル: devappserver2_test.py プロジェクト: Weirdln/goagent
  def test_path_given_does_not_exist(self):
    path = tempfile.mkdtemp()
    os.rmdir(path)

    self.assertEqual(
        path,
        devappserver2._get_storage_path(path, 'myapp'))
    self.assertTrue(os.path.isdir(path))
コード例 #3
0
    def test_no_path_given_directory_does_not_exist(self):
        path = tempfile.mkdtemp()
        os.rmdir(path)
        devappserver2._generate_storage_paths("example.com_myapp").AndReturn([path])

        self.mox.ReplayAll()
        self.assertEqual(path, devappserver2._get_storage_path(None, "dev~example.com:myapp"))
        self.mox.VerifyAll()
        self.assertTrue(os.path.isdir(path))
コード例 #4
0
    def test_no_path_given_directory_does_not_exist(self):
        path = tempfile.mkdtemp()
        os.rmdir(path)
        devappserver2._generate_storage_paths('example.com_myapp').AndReturn(
            [path])

        self.mox.ReplayAll()
        self.assertEqual(
            path, devappserver2._get_storage_path(None, 'example.com:myapp'))
        self.mox.VerifyAll()
        self.assertTrue(os.path.isdir(path))
コード例 #5
0
ファイル: devappserver2_test.py プロジェクト: Weirdln/goagent
  def test_no_path_given_directory_exists(self):
    path1 = tempfile.mkdtemp()
    os.chmod(path1, 0777)
    path2 = tempfile.mkdtemp()  # Made with mode 0700.

    devappserver2._generate_storage_paths('myapp').AndReturn([path1, path2])

    self.mox.ReplayAll()
    self.assertEqual(
        path2,
        devappserver2._get_storage_path(None, 'myapp'))
    self.mox.VerifyAll()
コード例 #6
0
    def test_no_path_given_directory_exists(self):
        path1 = tempfile.mkdtemp()
        os.chmod(path1, 0777)
        path2 = tempfile.mkdtemp()  # Made with mode 0700.

        devappserver2._generate_storage_paths("example.com_myapp").AndReturn([path1, path2])

        self.mox.ReplayAll()
        if sys.platform == "win32":
            expected_path = path1
        else:
            expected_path = path2
        self.assertEqual(expected_path, devappserver2._get_storage_path(None, "dev~example.com:myapp"))
        self.mox.VerifyAll()
コード例 #7
0
    def test_no_path_given_directory_exists(self):
        path1 = tempfile.mkdtemp()
        os.chmod(path1, 0o777)
        path2 = tempfile.mkdtemp()  # Made with mode 0700.

        devappserver2._generate_storage_paths('example.com_myapp').AndReturn(
            [path1, path2])

        self.mox.ReplayAll()
        if sys.platform == 'win32':
            expected_path = path1
        else:
            expected_path = path2
        self.assertEqual(
            expected_path,
            devappserver2._get_storage_path(None, 'dev~example.com:myapp'))
        self.mox.VerifyAll()
コード例 #8
0
ファイル: devappserver2_test.py プロジェクト: Weirdln/goagent
  def test_path_given_exists(self):
    path = tempfile.mkdtemp()

    self.assertEqual(
        path,
        devappserver2._get_storage_path(path, 'myapp'))
コード例 #9
0
    def test_path_given_exists(self):
        path = tempfile.mkdtemp()

        self.assertEqual(
            path, devappserver2._get_storage_path(path,
                                                  'dev~example.com:myapp'))
コード例 #10
0
    def test_path_given_exists(self):
        path = tempfile.mkdtemp()

        self.assertEqual(path, devappserver2._get_storage_path(path, "dev~example.com:myapp"))