Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Fixed requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellsayer committed Nov 26, 2019
1 parent 30e2f2c commit 757f34e
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 78 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ psycopg2 = ">=2.6.1"
requests = ">=2.7.0"
six = ">=1.9.0"
notebook = {extras = ["test"],version = ">=4.0"}
hybrid-content-manager = {editable = true,extras = ["test"],path = "."}
hybridcontents = {editable = true,extras = ["test"],path = "."}

[requires]
python_version = "3.6"
117 changes: 56 additions & 61 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,11 @@ def _validate_path(self, prefix, path):

path_is_valid = validator(path)

# Ensure return type is bool
if type(path_is_valid) is not bool:
raise HTTPError(
400,
"The provided path_validator for the prefix '{prefix}' does not return a boolean"
.format(prefix=prefix, path=path))

if not path_is_valid:
raise HTTPError(
401,
"The provided path_validator for the prefix '{prefix}' has flagged the path '{path}' as invalid."
.format(prefix=prefix, path=path))
405,
"The path '{path}' is not valid for the prefix '{prefix}'".
format(path=path, prefix=prefix))

return path_is_valid

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from IPython.utils.tempdir import TemporaryDirectory

from hybrid_content_manager.hybridmanager import HybridContentsManager
from hybridcontents.hybridmanager import HybridContentsManager

from .testing_utils import assertRaisesHTTPError

Expand Down Expand Up @@ -323,13 +323,13 @@ def test_rename_invalid_path(self):
old_path = 'Untitled.yaml'
new_path = 'A/Untitled.yaml'

with assertRaisesHTTPError(self, 401):
with assertRaisesHTTPError(self, 405):
cm.rename(old_path, new_path)

def test_save_invalid_path(self):
cm = self.contents_manager

with assertRaisesHTTPError(self, 401):
with assertRaisesHTTPError(self, 405):
cm.new_untitled(path='A', ext='.yaml')

def tearDown(self):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def main():
test_reqs = read_requirements('requirements_test.txt')

setup(
name='hybrid-content-manager',
name='hybridcontents',
version='0.6',
description="Hybrid Content Manager",
long_description=long_description,
author="viaduct.ai",
author_email="[email protected]",
packages=find_packages(include='hybrid_content_manager.*'),
packages=find_packages(include='hybridcontents.*'),
license='Apache 2.0',
include_package_data=True,
zip_safe=True,
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ deps =
py{27,36,37}-notebook{4,5,6}: .[test]

commands =
py{27,36,37}-notebook{4,5,6}: pytest hybrid_content_manager/tests
py{27,36,37}-notebook{4,5,6}: pytest hybridcontents/tests

0 comments on commit 757f34e

Please sign in to comment.