Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tuneit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
tuneit
Commits
853879a8
Commit
853879a8
authored
Feb 03, 2025
by
Anton Palgunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix load shop
parent
5f43805a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
main.py
src/shop/main.py
+10
-2
test_main.py
src/shop/test_main.py
+11
-0
No files found.
src/shop/main.py
View file @
853879a8
...
...
@@ -107,8 +107,16 @@ def retrieve_modules_full_list(force_refresh=False, initial_page=1, per_page=30)
# Пробуем скачать module.yaml
print
(
item
)
raw_url
=
f
"https://raw.githubusercontent.com/{item['owner']['login']}/{item['name']}/{item['default_branch']}/module.yaml"
module_info
=
parse_module_yaml
(
raw_url
)
raw_url_yaml
=
f
"https://raw.githubusercontent.com/{item['owner']['login']}/{item['name']}/{item['default_branch']}/module.yaml"
raw_url_yml
=
f
"https://raw.githubusercontent.com/{item['owner']['login']}/{item['name']}/{item['default_branch']}/module.yml"
module_info
=
parse_module_yaml
(
raw_url_yaml
)
if
not
module_info
:
module_info
=
parse_module_yaml
(
raw_url_yml
)
if
not
module_info
:
print
(
f
"Failed to parse module.yaml for {item['full_name']}"
)
continue
aggregated_repos
.
append
({
"source"
:
"github"
,
...
...
src/shop/test_main.py
View file @
853879a8
...
...
@@ -9,6 +9,17 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')
from
shop.main
import
retrieve_modules_full_list
,
load_from_cache
,
save_to_cache
,
fetch_repos_from_github
,
fetch_repos_from_gitlab
@patch
(
"shop.main.load_from_cache"
)
@patch
(
"shop.main.save_to_cache"
)
def
test_retrive_real_data
(
mock_save_cache
,
mock_load_cache
):
# Mock cache data
mock_load_cache
.
return_value
=
(
None
,
0
)
repos
=
retrieve_modules_full_list
(
force_refresh
=
True
,
initial_page
=
1
,
per_page
=
30
)
assert
len
(
repos
)
>
0
@patch
(
"shop.main.load_from_cache"
)
@patch
(
"shop.main.save_to_cache"
)
@patch
(
"shop.main.fetch_repos_from_github"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment