Skip to content

Commit

Permalink
Bump to version 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
florianmahner committed Jun 19, 2024
1 parent 971b8e2 commit 7342313
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tomlparse"
version = "1.0.1"
version = "1.1.0"
description = "This is a template repository for Python projects that use Poetry for their dependency management."
authors = ["florianmahner <[email protected]>"]
repository = "https://github.com/florianmahner/tomlparse"
Expand Down
22 changes: 11 additions & 11 deletions tests/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
import unittest
from io import StringIO

from tomlparse import argparse
import tomlparse


class TestArgparse(unittest.TestCase):
def test_cmdl_without_args(self):
parser = argparse.ArgumentParser()
parser = tomlparse.ArgumentParser()
sys.argv = ["test_argparse.py"]
default_args, sys_args = parser.extract_args()
changed_args = parser.find_changed_args(default_args, sys_args)
self.assertEqual(changed_args, [])

def test_cmdl_with_args(self):
parser = argparse.ArgumentParser(description="Test ArgumentParser")
parser = tomlparse.ArgumentParser(description="Test ArgumentParser")
sys.argv = [
"test_argparse.py",
"--config",
Expand All @@ -28,7 +28,7 @@ def test_cmdl_with_args(self):
self.assertEqual(changed_args, ["config", "table"])

def test_cmdl_with_args_as_param(self):
parser = argparse.ArgumentParser(description="Test ArgumentParser")
parser = tomlparse.ArgumentParser(description="Test ArgumentParser")
args = [
"--config",
"config.toml",
Expand All @@ -40,7 +40,7 @@ def test_cmdl_with_args_as_param(self):
self.assertEqual(changed_args, ["config", "table"])

def test_cmdl_with_namespace(self):
parser = argparse.ArgumentParser(description="Test ArgumentParser")
parser = tomlparse.ArgumentParser(description="Test ArgumentParser")
args = [
"--config",
"config.toml",
Expand All @@ -58,7 +58,7 @@ class Namespace:
self.assertIs(sys_args, namespace)

def test_remove_nested_keys(self):
parser = argparse.ArgumentParser(description="Test ArgumentParser")
parser = tomlparse.ArgumentParser(description="Test ArgumentParser")
sys.argv = [
"test_argparse.py",
"--config",
Expand All @@ -84,7 +84,7 @@ def test_remove_nested_keys(self):

def test_parse_args(self):
# Test general arguments
parser = argparse.ArgumentParser(description="Test ArgumentParser")
parser = tomlparse.ArgumentParser(description="Test ArgumentParser")
sys.argv = ["test_argparse.py"]
parser.add_argument("--foo", type=int, default=0)
parser.add_argument("--bar", type=str, default="")
Expand Down Expand Up @@ -112,7 +112,7 @@ def test_parse_args(self):
self.assertEqual(args.bar, "hello")

def test_parse_args_with_namespace(self):
parser = argparse.ArgumentParser(description="Test ArgumentParser")
parser = tomlparse.ArgumentParser(description="Test ArgumentParser")
parser.add_argument("--foo", type=int, default=0)
parser.add_argument("--bar", type=str, default="")

Expand All @@ -130,7 +130,7 @@ class Namespace:
self.assertEqual(args.bar, "hello")

def test_missing_toml(self):
parser = argparse.ArgumentParser(description="Test ArgumentParser")
parser = tomlparse.ArgumentParser(description="Test ArgumentParser")
sys.argv = ["test_argparse.py", "--config", "./tests/missing.toml"]
stderr = StringIO()
with self.assertRaises(SystemExit), contextlib.redirect_stderr(stderr):
Expand All @@ -141,7 +141,7 @@ def test_missing_toml(self):
)

def test_missing_section(self):
parser = argparse.ArgumentParser(description="Test ArgumentParser")
parser = tomlparse.ArgumentParser(description="Test ArgumentParser")
sys.argv = [
"test_argparse.py",
"--config",
Expand All @@ -158,7 +158,7 @@ def test_missing_section(self):
)

def test_combined_section(self):
parser = argparse.ArgumentParser(description="Test ArgumentParser")
parser = tomlparse.ArgumentParser(description="Test ArgumentParser")
sys.argv = [
"test_argparse.py",
"--config",
Expand Down

0 comments on commit 7342313

Please sign in to comment.