Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from contentcuration.utils.appnexus.base import Backend, Adapter
from automation.utils.appnexus.base import Adapter
from automation.utils.appnexus.base import Backend


class MockBackend(Backend):
def connect(self) -> None:
Expand Down Expand Up @@ -27,15 +29,18 @@ def test_backend_singleton():
b1, b2 = MockBackend.get_instance(), MockBackend.get_instance()
assert id(b1) == id(b2)


def test_adapter_creation():
a = MockAdapter(backend=MockBackend)
assert isinstance(a, Adapter)


def test_adapter_backend_default():
b = MockBackend()
adapter = Adapter(backend=b)
assert isinstance(adapter.backend, Backend)


def test_adapter_backend_custom():
b = MockBackend()
a = Adapter(backend=b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ABSTRACT CLASS Backend:
ABSTRACT METHOD request(params)
# provide blue print for the request object
pass

ABSTRACT METHOD response(params)
# provides blue print for the response object
pass
Expand Down
Empty file.
1 change: 1 addition & 0 deletions contentcuration/automation/utils/appnexus/backends.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Implementation of ML, GCS Backend etc.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from abc import ABC, abstractmethod
from abc import ABC
from abc import abstractmethod
from builtins import NotImplementedError
from typing import Union, Dict
from typing import Dict
from typing import Union


class Backend(ABC):
Expand Down
2 changes: 0 additions & 2 deletions contentcuration/contentcuration/utils/appnexus/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion contentcuration/contentcuration/utils/appnexus/backends.py

This file was deleted.