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

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 11, 2023
1 parent fc40d91 commit 46a98d9
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion network_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


def main(global_config, **settings):

engine = engine_from_config(settings, "sqlalchemy.")
DBSession.configure(bind=engine)
Base.metadata.bind = engine
Expand Down
1 change: 0 additions & 1 deletion network_manager/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def local_node() -> Optional[Node]:

@staticmethod
def refresh_github_node_registry():

node_registry_data = NodeRegistry.get_node_registry()
node_info_data = NodeRegistry.get_node_info()

Expand Down
1 change: 0 additions & 1 deletion network_manager/node_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def get_node_registry():

@staticmethod
def get_node_info():

"""
Gets information from the node info repository at the given url.
Returns the information in json format
Expand Down
2 changes: 0 additions & 2 deletions network_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class NodeViews:
"""

def __init__(self, request):

self.request = request

@property
Expand Down Expand Up @@ -63,7 +62,6 @@ def node_form(self):

# Used for Node Update form
class NodeForm(colander.MappingSchema):

name = colander.SchemaNode(colander.String(), default=node_name_default)
url = colander.SchemaNode(colander.String(), default=node_url_default)
location = colander.SchemaNode(colander.String(), default=node_location_default)
Expand Down
4 changes: 0 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@


def get_engine(settings, prefix="sqlalchemy."):

return engine_from_config(settings, prefix)


def get_session_factory(engine):

factory = sessionmaker()

factory.configure(bind=engine)
Expand All @@ -44,7 +42,6 @@ def get_session_factory(engine):


def get_tm_session(session_factory, transaction_manager, request=None):

"""
Get a ``sqlalchemy.orm.Session`` instance backed by a transaction.
Expand Down Expand Up @@ -207,7 +204,6 @@ def tm():

@pytest.fixture
def dbsession(app, tm):

DBSession = scoped_session(sessionmaker())
return DBSession

Expand Down
1 change: 0 additions & 1 deletion tests/old_test_expectation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

@pytest.mark.parametrize("test_input,expected", [(1, "PAVICS"), (2, "UofT")])
class TestNodeFunctionalTestsPyTest:

# If the table is created, test if the information for a specific node is as expected
# Uses sample information from the node registry
def test_node_info_view(self, test_input, expected):
Expand Down
4 changes: 0 additions & 4 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@


def makeUser(name, role):

return models.User(name=name, role=role)


def setUser(config, user):

config.set_security_policy(DummySecurityPolicy(identity=user))


def makeNode(node_id, node_name, url, location, affiliation, support_contact, deployed_since, data, compute, local):

return models.Node(
id=node_id,
name=node_name,
Expand Down Expand Up @@ -212,7 +209,6 @@ def _addRoutes(self, config):

# @requests_mock.Mocker()
def test_it(self, dummy_config, dummy_request, requests_mock):

self._addRoutes(dummy_config)

# requests_mock_post = requests_mock.post('http://localhost:6543/node/edit', text='mockposttest')
Expand Down
6 changes: 0 additions & 6 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def _initTestingDB():

from sqlalchemy import create_engine

from network_manager.models import (
Expand All @@ -23,7 +22,6 @@ def _initTestingDB():
DBSession.configure(bind=engine)

with transaction.manager:

model = Node(node_name="node test", node_description="This is the description for node test")

DBSession.add(model)
Expand All @@ -33,13 +31,11 @@ def _initTestingDB():

class NodeViewTests(unittest.TestCase):
def setUp(self):

self.session = _initTestingDB()

self.config = testing.setUp()

def tearDown(self):

self.session.remove()

testing.tearDown()
Expand All @@ -65,7 +61,6 @@ def test_node_register_view(self):

class NodeFunctionalTests(unittest.TestCase):
def setUp(self):

from pyramid.paster import get_app

app = get_app("development.ini")
Expand All @@ -75,7 +70,6 @@ def setUp(self):
self.testapp = TestApp(app)

def tearDown(self):

from network_manager.models import DBSession

DBSession.remove()

0 comments on commit 46a98d9

Please sign in to comment.