Skip to content

Commit

Permalink
restore
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Nov 20, 2024
1 parent 25eb1fb commit 2c86cc5
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

all:
make -C make
python3 tests/py/deps_tests.py
python3 py/deps_tests.py

clean:
make -C make clean
49 changes: 49 additions & 0 deletions py/deps_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# The MIT License (MIT)
#
# Copyright (c) 2016-2024 Objectionary.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import unittest
from unittest.mock import patch
import sys
sys.path.insert(0, './py/')
from deps import dependencies

class AutoPullTest(unittest.TestCase):
mock_file_content = """
+rt jvm org.eolang:eo-runtime:0.29.5
+rt jvm org.eolang:eo-files:0.4.0
+rt jvm org.eolang:eo-hamcrest:0.4.0
"""

@unittest.mock.patch(
'builtins.open',
new=unittest.mock.mock_open(read_data=mock_file_content),
create=True
)
def test(self):
self.assertEqual(
dependencies(),
{'eo:0.29.5', 'eo-hamcrest:0.4.0', 'eo-files:0.4.0'}
)


if __name__ == '__main__':
unittest.main()

0 comments on commit 2c86cc5

Please sign in to comment.