<pre style='margin:0'>
Renee Otten (reneeotten) pushed a commit to branch master
in repository upt-macports.

</pre>
<p><a href="https://github.com/macports/upt-macports/commit/0184241d5ec39d0585512fd706b6d1051743a602">https://github.com/macports/upt-macports/commit/0184241d5ec39d0585512fd706b6d1051743a602</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 0184241d5ec39d0585512fd706b6d1051743a602
</span>Author: Korusuke <karan.sheth@somaiya.edu>
AuthorDate: Wed Jul 3 03:35:03 2019 +0530

<span style='display:block; white-space:pre;color:#404040;'>    Adding more tests
</span>---
 upt_macports/tests/test_perl_package.py   |  7 +++++++
 upt_macports/tests/test_python_package.py | 26 ++++++++++++++++++++++++++
 upt_macports/tests/test_ruby_package.py   |  7 +++++++
 3 files changed, 40 insertions(+)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/upt_macports/tests/test_perl_package.py b/upt_macports/tests/test_perl_package.py
</span><span style='display:block; white-space:pre;color:#808080;'>index bd7f891..e340ea6 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/upt_macports/tests/test_perl_package.py
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/upt_macports/tests/test_perl_package.py
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -22,6 +22,13 @@ class TestMacPortsPerlPackage(unittest.TestCase):
</span>             self.package.upt_pkg = upt.Package(name, '13.37')
             self.assertEqual(self.package._pkgname(), expected_name)
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    def test_folder_name(self):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        expected = ['p5-foo-bar', 'p5-foo-bar', 'p5-foo-bar', 'p5-foo-bar']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        names = ['Foo::bar', 'foo::bar', 'Foo-bar', 'foo-bar']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        for (name, expected_name) in zip(names, expected):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            self.assertEqual(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                self.package._normalized_macports_folder(name), expected_name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span>     @requests_mock.mock()
     def test_missing_dist_pos1(self, requests):
         expected = ' ../../authors/id/F/FO/FOOBAR/'
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/upt_macports/tests/test_python_package.py b/upt_macports/tests/test_python_package.py
</span><span style='display:block; white-space:pre;color:#808080;'>index 3639af9..f772f0a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/upt_macports/tests/test_python_package.py
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/upt_macports/tests/test_python_package.py
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -17,6 +17,32 @@ class TestMacPortsPythonPackage(unittest.TestCase):
</span>             self.package.upt_pkg = upt.Package(name, '13.37')
             self.assertEqual(self.package._pkgname(), expected_name)
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    def test_folder_name(self):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        expected = ['py-foo', 'py-py-foo', 'py-pyfoo', 'py-pyfoo']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        names = ['foo', 'py-foo', 'pyfoo', 'pyFoo']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        for (name, expected_name) in zip(names, expected):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            self.assertEqual(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                self.package._normalized_macports_folder(name), expected_name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    def test_py_root_name(self):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        url_names = ['foo', 'Foo', 'Foo', 'foo']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        pypi_names = ['foo', 'foo', 'pyFoo', 'py-Foo']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        urls = [
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            'https://fakepypi.com/random/path/foo-13.37.tar.gz',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            'https://fakepypi.com/random/path/Foo-13.37.tar.gz',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            'https://fakepypi.com/random/path/Foo-13.37.tar.gz',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            'https://fakepypi.com/random/path/foo-13.37.tar.gz'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        for (url_name, pypi_name, url) in zip(url_names, pypi_names, urls):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            self.package.upt_pkg = upt.Package(pypi_name, '13.37')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            self.package.upt_pkg.archives = [upt.Archive(url)]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            if url_name != pypi_name:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                self.assertEqual(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    self.package._python_root_name(), url_name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            else:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                self.assertEqual(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    self.package._python_root_name(), None)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> 
 if __name__ == '__main__':
     unittest.main()
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/upt_macports/tests/test_ruby_package.py b/upt_macports/tests/test_ruby_package.py
</span><span style='display:block; white-space:pre;color:#808080;'>index 22d231f..b6489bb 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/upt_macports/tests/test_ruby_package.py
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/upt_macports/tests/test_ruby_package.py
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -17,6 +17,13 @@ class TestMacPortsRubyPackage(unittest.TestCase):
</span>             self.package.upt_pkg = upt.Package(name, '13.37')
             self.assertEqual(self.package._pkgname(), expected_name)
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    def test_folder_name(self):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        expected = ['rb-foo', 'rb-foo', 'rb-foo-bar', 'rb-foo-bar']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        names = ['Foo', 'foo', 'Foo-bar', 'foo-bar']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        for (name, expected_name) in zip(names, expected):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            self.assertEqual(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                self.package._normalized_macports_folder(name), expected_name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> 
 if __name__ == '__main__':
     unittest.main()
</pre><pre style='margin:0'>

</pre>