From 80df0f2591351ca29f3fcd9de076bbbaa12c9f1a Mon Sep 17 00:00:00 2001 From: Tycho Pandelaar Date: Mon, 9 Oct 2023 18:05:55 +0200 Subject: [PATCH] __init__.py --- LICENSE | 2 +- __init__.py | 0 tests/__init__.py | 0 tests/test_main.py | 41 ----------------------------------- tests/test_table.py | 52 --------------------------------------------- 5 files changed, 1 insertion(+), 94 deletions(-) create mode 100644 __init__.py create mode 100644 tests/__init__.py delete mode 100644 tests/test_main.py delete mode 100644 tests/test_table.py diff --git a/LICENSE b/LICENSE index 72701af..b53d90e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 tychop +Copyright (c) 2023 Tycho Pandelaar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_main.py b/tests/test_main.py deleted file mode 100644 index afa8712..0000000 --- a/tests/test_main.py +++ /dev/null @@ -1,41 +0,0 @@ -import unittest -from main import show_usage - - -class TestMain(unittest.TestCase): - - def test_show_usage(self): - expected_usage = """ -Usage: - `gitgrove COMMAND` - - or one of the shortcuts: - `gg COMMAND`, `ggs`, `ggf`, `ggp`, `ggpr`, `ggc`, `ggb BRANCH`, `ggd` - -Commands: - -s, --status : Show all the repository statuses. - -f, --fetch : Fetch all repositories. - -p, --pull : Pull all repositories. - -pr, --prune : Prunes objects that are no longer reachable. - -c, --cleanup : Clean up and optimize the local repositories. - -b, --branch BRANCH: Switch all repositories to a specified branch. - -d, --development : Switch all repositories to the development branch. - -Shortcuts: - gg : Same as gitgrove. - ggs : Show all the repository statuses. - ggf : Fetch all repositories. - ggp : Pull all repositories. - ggpr : Prunes objects that are no longer reachable. - ggc : Clean up and optimize the local repositories. - ggb BRANCH: Switch all repositories to a specified branch. - ggd : Switch all repositories to the development branch. -""" - - actual_usage = show_usage() - - self.assertEqual(expected_usage, actual_usage) - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_table.py b/tests/test_table.py deleted file mode 100644 index b4818d7..0000000 --- a/tests/test_table.py +++ /dev/null @@ -1,52 +0,0 @@ -import unittest -from src.table import ( - Table, TableRenderer, Cell, ANSI_BOLD_BRIGHT_WHITE, ANSI_WHITE, - ANSI_RED, ANSI_GREEN, ANSI_CYAN, ANSI_PURPLE, ANSI_GREY -) - - -class TestCell(unittest.TestCase): - - def test_init(self): - cell = Cell("Hello, world!") - - self.assertEqual(cell.content, "Hello, world!") - self.assertEqual(cell.justify, "left") - self.assertEqual(cell.color, ANSI_WHITE) - - cell = Cell("Hello, world!", justify="right", color=ANSI_RED) - - self.assertEqual(cell.content, "Hello, world!") - self.assertEqual(cell.justify, "right") - self.assertEqual(cell.color, ANSI_RED) - - -class TestTable(unittest.TestCase): - - def test_init(self): - table = Table() - self.assertEqual(table.rows, []) - - -class TestTableIntegration(unittest.TestCase): - - def test_render_table(self): - table = Table() - table.add_row(["Name", "Age"]) - table.add_row(["John Doe", 30]) - - renderer = TableRenderer(table, ANSI_GREY, ANSI_WHITE) - rendered_table = renderer.render() - - expected_rendered_table = """ - ╔═══════╦═══════╗ - ║ Name ║ Age ║ - ╠═══════╬═══════╣ - ║ John Doe ║ 30 ║ - ╚═══════╩═══════╝ -""" - - self.assertEqual(rendered_table, expected_rendered_table) - -if __name__ == '__main__': - unittest.main()