Skip to content

Commit 2b84abe

Browse files
committed
Changed default instance to my own server, hosted on AWS
1 parent 753efad commit 2b84abe

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ venv/
112112
ENV/
113113
env.bak/
114114
venv.bak/
115+
Pipfile
115116

116117
# Spyder project settings
117118
.spyderproject

src/gutenberg/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import requests
2-
from models import APIException, Book
2+
3+
from .models import APIException, Book
34

45

56
class GutenbergAPI:
@@ -11,7 +12,7 @@ class GutenbergAPI:
1112
# lots of money and response times will be much faster for you.
1213
# The instructions for self-hosting can be found here:
1314
# https://github.com/garethbjohnson/gutendex/wiki/Installation-Guide
14-
def __init__(self, instance_url="https://gutendex.com"):
15+
def __init__(self, instance_url="https://gutendex.devbranch.co"):
1516
self.instance_url = instance_url
1617

1718
# Methods for getting or searching for lists of books

tests/test_gutenberg.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import unittest
22

3-
from gutenberg.gutenberg import GutenbergAPI
3+
from gutenberg import GutenbergAPI
44

55

66
class TestSimple(unittest.TestCase):
77
def test_alwaystrue(self):
88
self.assertEqual(1, 1)
99

10+
def test_instance_is_default(self):
11+
gb = GutenbergAPI()
12+
self.assertEqual(gb.instance_url, "https://gutendex.devbranch.co")
13+
1014

1115
if __name__ == "__main__":
1216
unittest.main()

0 commit comments

Comments
 (0)