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
4 changes: 2 additions & 2 deletions src/http_cli/__init__.py → PyFetch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""HTTP CLI client library for making HTTP requests."""

from http_cli.exceptions import HTTPClientError, HTTPConnectionError, ResponseError
from http_cli.http_client import HTTPClient
from PyFetch.exceptions import HTTPClientError, HTTPConnectionError, ResponseError
from PyFetch.http_client import HTTPClient

__all__ = ["HTTPClient", "HTTPClientError", "HTTPConnectionError", "ResponseError"]
2 changes: 1 addition & 1 deletion src/http_cli/__main__.py → PyFetch/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sys

from http_cli.cli import main
from PyFetch.cli import main

if __name__ == "__main__":
try:
Expand Down
4 changes: 2 additions & 2 deletions src/http_cli/cli.py → PyFetch/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import sys
import textwrap

from http_cli.exceptions import HTTPClientError
from http_cli.http_client import HTTPClient
from PyFetch.exceptions import HTTPClientError
from PyFetch.http_client import HTTPClient


def show_examples(suppress_output=False):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/http_cli/http_client.py → PyFetch/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import requests

from http_cli.exceptions import HTTPClientError, HTTPConnectionError, ResponseError
from PyFetch.exceptions import HTTPClientError, HTTPConnectionError, ResponseError


class HTTPClient:
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
setup(
name="PyFetch",
version="1.0.0",
packages=find_packages(where="src"),
package_dir={"": "src"},
packages=find_packages(include=["PyFetch", "PyFetch.*"]), # updated packages lookup
package_dir={"PyFetch": "PyFetch"}, # updated package directory mapping
install_requires=[
"requests>=2.25.1",
],
entry_points={
"console_scripts": [
"pyfetch=http_cli.cli:main",
"pyfetch=PyFetch.cli:main",
],
},
author="Malte Mindedal",
Expand Down
6 changes: 3 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest
from unittest.mock import patch

from http_cli.cli import main, show_examples
from PyFetch.cli import main, show_examples


class TestCLI(unittest.TestCase):
Expand All @@ -23,8 +23,8 @@ def test_help_command(self):
main(suppress_output=True)
self.assertEqual("", fake_stdout.getvalue())

@patch("PyFetch.http_client.HTTPClient.get")
@patch("sys.argv", ["http_cli", "GET", "https://api.example.com"])
@patch("http_cli.http_client.HTTPClient.get")
def test_get_command(self, mock_get):
"""Test the GET command"""
mock_get.return_value.status_code = 200
Expand All @@ -34,11 +34,11 @@ def test_get_command(self, mock_get):
main()
mocked_print.assert_called_with("Success")

@patch("PyFetch.http_client.HTTPClient.post")
@patch(
"sys.argv",
["http_cli", "POST", "https://api.example.com", "-d", '{"key": "value"}'],
)
@patch("http_cli.http_client.HTTPClient.post")
def test_post_command(self, mock_post):
"""Test the POST command"""
mock_post.return_value.status_code = 201
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import unittest

from http_cli.exceptions import HTTPClientError
from PyFetch.exceptions import HTTPClientError


class TestHTTPClientError(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import unittest
from unittest.mock import patch

from http_cli.exceptions import HTTPClientError
from http_cli.http_client import HTTPClient
from PyFetch.exceptions import HTTPClientError
from PyFetch.http_client import HTTPClient


class TestHTTPClient(unittest.TestCase):
Expand Down