diff --git a/README.rst b/README.rst index 460d6d8..ee48bd8 100644 --- a/README.rst +++ b/README.rst @@ -82,7 +82,7 @@ Fail Examples: GET /api/register/191GVvAaTRxLmz3rW3nU5jAV1rF186VxQc/ RESPONSE: Status Code: 409 - Text: Registration Failed: Address Already Is Registered. + Text: Registration failed: Address already is registered. Ping-Pong ********* @@ -101,7 +101,7 @@ Success Example: GET /api/ping/191GVvAaTRxLmz3rW3nU5jAV1rF186VxQc/ RESPONSE: Status Code: 200 - Text: Ping Accepted. + Text: Ping accepted. Fail Examples: @@ -110,7 +110,7 @@ Fail Examples: GET /api/ping/notvalidaddress/ RESPONSE: Status Code: 400 - Text: Ping Failed: Invalid BTC Address. + Text: Ping failed: Invalid Bitcoin address. GET /api/ping/1EawBV7n7f2wDbgxJfNzo1eHyQ9Gj77oJd/ RESPONSE: @@ -129,7 +129,7 @@ is 15 minutes. GET /api/online/ -Success Examples: +Success Example: :: @@ -161,7 +161,7 @@ Success Example: GET /api/height/191GVvAaTRxLmz3rW3nU5jAV1rF186VxQc/50/ RESPONSE: Status Code: 200 - Text: Height Accepted. + Text: Height accepted. Fail Examples: @@ -170,7 +170,7 @@ Fail Examples: GET /api/height/notvalidaddress/50/ RESPONSE: Status Code: 400 - Text: Ping Failed: Invalid BTC Address. + Text: Ping Failed: Invalid Bitcoin address. GET /api/height/1EawBV7n7f2wDbgxJfNzo1eHyQ9Gj77oJd/50/ RESPONSE: diff --git a/dataserv/app.py b/dataserv/app.py index 93e9ace..6854214 100644 --- a/dataserv/app.py +++ b/dataserv/app.py @@ -39,10 +39,10 @@ def register(btc_addr): user.register() return make_response("User registered.", 200) except ValueError: - msg = "Invalid BTC Address." + msg = "Invalid Bitcoin address." return make_response(error_msg.format(msg), 400) except LookupError: - msg = "Address Already Is Registered." + msg = "Address already is registered." return make_response(error_msg.format(msg), 409) @@ -57,12 +57,12 @@ def ping(btc_addr): # attempt to ping the farmer/farming address try: user.ping() - return make_response("Ping Accepted.", 200) + return make_response("Ping accepted.", 200) except ValueError: - msg = "Invalid BTC Address." + msg = "Invalid Bitcoin address." return make_response(error_msg.format(msg), 400) except LookupError: - msg = "Farmer Not Found." + msg = "Farmer not found." return make_response(error_msg.format(msg), 404) @@ -98,12 +98,12 @@ def set_height(btc_addr, height): # attempt to set height try: user.set_height(height) - return make_response("Height Accepted.", 200) + return make_response("Height accepted.", 200) except ValueError: - msg = "Invalid BTC Address." + msg = "Invalid Bitcoin address." return make_response(msg, 400) except LookupError: - msg = "Farmer Not Found." + msg = "Farmer not found." return make_response(msg, 404) diff --git a/tests/test_App.py b/tests/test_App.py index fe3b6b8..8fea7c3 100644 --- a/tests/test_App.py +++ b/tests/test_App.py @@ -30,14 +30,14 @@ def test_register(self): # duplicate registration rv = self.app.get('/api/register/{0}'.format(addr)) - self.assertEqual(b"Registration Failed: Address Already Is Registered.", rv.data) + self.assertEqual(b"Registration Failed: Address already is registered.", rv.data) self.assertEqual(rv.status_code, 409) def test_register_invalid(self): addr = '191GVvAaTRxLmz3rW3nU5jAV1rF186VxQc_this_is_not_an_address' rv = self.app.get('/api/register/{0}'.format(addr)) - self.assertEqual(b"Registration Failed: Invalid BTC Address.", rv.data) + self.assertEqual(b"Registration Failed: Invalid Bitcoin address.", rv.data) self.assertEqual(rv.status_code, 400) # ping call @@ -53,7 +53,7 @@ def test_ping_good(self): rv = self.app.get('/api/ping/{0}'.format(addr)) # good ping - self.assertEqual(b"Ping Accepted.", rv.data) + self.assertEqual(b"Ping accepted.", rv.data) self.assertEqual(rv.status_code, 200) def test_ping_not_found(self): @@ -64,7 +64,7 @@ def test_ping_not_found(self): rv = self.app.get('/api/ping/{0}'.format(addr)) # good ping - self.assertEqual(b"Ping Failed: Farmer Not Found.", rv.data) + self.assertEqual(b"Ping Failed: Farmer not found.", rv.data) self.assertEqual(rv.status_code, 404) def test_ping_invalid_address(self): @@ -74,7 +74,7 @@ def test_ping_invalid_address(self): rv = self.app.get('/api/ping/{0}'.format(addr)) # good ping - self.assertEqual(b"Ping Failed: Invalid BTC Address.", rv.data) + self.assertEqual(b"Ping Failed: Invalid Bitcoin address.", rv.data) self.assertEqual(rv.status_code, 400) # time helper diff --git a/tests/test_Builder.py b/tests/test_Builder.py index 02d4b27..3aeedda 100644 --- a/tests/test_Builder.py +++ b/tests/test_Builder.py @@ -11,7 +11,7 @@ def test_builder(self): my_max_size = 1024*1024*256 # 256 MB bucket = Builder(my_address, my_shard_size, my_max_size) - bucket.build(my_store_path, False, True) + bucket.build(my_store_path, True, True) def test_generate(self): my_address = "191GVvAaTRxLmz3rW3nU5jAV1rF186VxQc"