odooflow-cli 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {odooflow_cli-0.1.0/odooflow_cli.egg-info → odooflow_cli-0.2.0}/PKG-INFO +55 -16
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/README.md +54 -15
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0/odooflow_cli.egg-info}/PKG-INFO +55 -16
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow_cli.egg-info/top_level.txt +0 -1
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/pyproject.toml +1 -1
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/tests/test_commands_init_module_env.py +3 -3
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/tests/test_config_manager.py +3 -3
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/tests/test_utils_env.py +12 -12
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/LICENSE +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/__init__.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/cli.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/commands/__init__.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/commands/clone_module.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/commands/config.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/commands/init_module_env.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/commands/keygen.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/commands/push.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/commands/remote.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/commands/sync_env.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/config_manager.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/utils/env.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow/utils/ssh.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow_cli.egg-info/SOURCES.txt +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow_cli.egg-info/dependency_links.txt +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow_cli.egg-info/entry_points.txt +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/odooflow_cli.egg-info/requires.txt +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/setup.cfg +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/tests/__init__.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/tests/test_commands_config.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/tests/test_commands_keygen.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/tests/test_commands_remote.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/tests/test_commands_sync_env.py +0 -0
- {odooflow_cli-0.1.0 → odooflow_cli-0.2.0}/tests/test_utils_ssh.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odooflow-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: OdooFlow CLI - streamline your Odoo development workflow
|
|
5
5
|
Author: Mohammad A. Hamdan
|
|
6
6
|
License: MIT
|
|
@@ -33,31 +33,39 @@ Dynamic: license-file
|
|
|
33
33
|
|
|
34
34
|
# 🌀 Odooflow CLI
|
|
35
35
|
|
|
36
|
-
**
|
|
36
|
+
**OdooFlow CLI** is a command-line interface tool designed to streamline the development workflow for Odoo projects. It helps clone Odoo modules (and their dependencies), handles GitLab lookups, and provides bounded recursive cloning via a configurable depth.
|
|
37
37
|
|
|
38
38
|
## 🚀 Features
|
|
39
39
|
|
|
40
40
|
- Clone an Odoo module by Git URL
|
|
41
|
-
- Recursively resolve and clone
|
|
41
|
+
- Recursively resolve and clone dependencies up to a configurable depth
|
|
42
42
|
- Smart skip of Odoo core modules
|
|
43
43
|
- Branch selection for cloning
|
|
44
|
+
- Post-push command execution on the remote server
|
|
45
|
+
- Built-in SSH key generation
|
|
44
46
|
- Helpful and colorful CLI output
|
|
45
|
-
- Built using [Typer](https://typer.tiangolo.com/) and Python 3.
|
|
47
|
+
- Built using [Typer](https://typer.tiangolo.com/) and Python 3.7+
|
|
46
48
|
|
|
47
49
|
---
|
|
48
50
|
|
|
49
51
|
## 📦 Installation
|
|
50
52
|
|
|
51
53
|
```bash
|
|
52
|
-
git clone https://github.com/
|
|
54
|
+
git clone https://github.com/anomalyco/odooflow-cli.git
|
|
53
55
|
cd odooflow-cli
|
|
54
56
|
pip install .
|
|
55
57
|
```
|
|
56
58
|
|
|
57
|
-
Or install directly from source for development:
|
|
59
|
+
Or install directly from source for development (with test/lint extras):
|
|
58
60
|
|
|
59
61
|
```bash
|
|
60
|
-
pip install -e .
|
|
62
|
+
pip install -e .[dev]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Install from PyPI (once published):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install odooflow-cli
|
|
61
69
|
```
|
|
62
70
|
|
|
63
71
|
---
|
|
@@ -82,11 +90,18 @@ odooflow --help
|
|
|
82
90
|
|
|
83
91
|
### Clone Command Options:
|
|
84
92
|
|
|
85
|
-
| Flag
|
|
86
|
-
|
|
87
|
-
| `--url`
|
|
88
|
-
| `--branch
|
|
89
|
-
| `--
|
|
93
|
+
| Flag | Description |
|
|
94
|
+
|----------------|--------------------------------------------------------------------------------------------------------|
|
|
95
|
+
| `--url` | Full HTTP URL of the module repo |
|
|
96
|
+
| `--branch`/`-b`| (Optional) Git branch to clone from |
|
|
97
|
+
| `--depth`/`-d` | Max dependency depth to clone. `1` clones only the target module, `2` clones target + immediate deps, etc. (default: `1`) |
|
|
98
|
+
|
|
99
|
+
### Push Command Options:
|
|
100
|
+
|
|
101
|
+
| Flag | Description |
|
|
102
|
+
|-----------------|-----------------------------------------------------------------------------|
|
|
103
|
+
| `--remote-only` | Skip Git push and only upload to server |
|
|
104
|
+
| `--exec` | Custom shell command to execute on the server after pushing |
|
|
90
105
|
|
|
91
106
|
### 🔍 Examples:
|
|
92
107
|
|
|
@@ -102,10 +117,34 @@ Clone with specific branch:
|
|
|
102
117
|
odooflow clone --url https://gitlab.com/mygroup/my_odoo_module.git --branch 17.0
|
|
103
118
|
```
|
|
104
119
|
|
|
105
|
-
Clone
|
|
120
|
+
Clone target + immediate dependencies (depth 2):
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
odooflow clone --url https://gitlab.com/mygroup/my_odoo_module.git --depth 2
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Clone the full dependency tree (depth 5):
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
odooflow clone --url https://gitlab.com/mygroup/my_odoo_module.git --depth 5
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Push current branch to Git and upload to the configured server:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
odooflow push
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Push and execute a custom command on the remote server after upload:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
odooflow push --exec "sudo systemctl restart odoo"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Skip Git push, only upload to server:
|
|
106
145
|
|
|
107
146
|
```bash
|
|
108
|
-
odooflow
|
|
147
|
+
odooflow push --remote-only
|
|
109
148
|
```
|
|
110
149
|
|
|
111
150
|
---
|
|
@@ -133,7 +172,7 @@ odooflow/
|
|
|
133
172
|
├── tests/
|
|
134
173
|
├── README.md
|
|
135
174
|
├── requirements.txt
|
|
136
|
-
├──
|
|
175
|
+
├── pyproject.toml
|
|
137
176
|
└── LICENSE
|
|
138
177
|
```
|
|
139
178
|
|
|
@@ -161,7 +200,7 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
|
|
|
161
200
|
|
|
162
201
|
Move this CLI into fully-integrated Odoo environment, using Odoo, users can create issues, add the amount of details, then sync these issues with Odooflow.
|
|
163
202
|
|
|
164
|
-
We can do integration with any code agent to help developers to achieve these issues
|
|
203
|
+
We can do integration with any code agent to help developers to achieve these issues
|
|
165
204
|
|
|
166
205
|
same thing for pipelines, I think it will be amazing if developers can build pipelines using Odoo, then apply the same pipelines using Odooflow.
|
|
167
206
|
|
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
# 🌀 Odooflow CLI
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**OdooFlow CLI** is a command-line interface tool designed to streamline the development workflow for Odoo projects. It helps clone Odoo modules (and their dependencies), handles GitLab lookups, and provides bounded recursive cloning via a configurable depth.
|
|
4
4
|
|
|
5
5
|
## 🚀 Features
|
|
6
6
|
|
|
7
7
|
- Clone an Odoo module by Git URL
|
|
8
|
-
- Recursively resolve and clone
|
|
8
|
+
- Recursively resolve and clone dependencies up to a configurable depth
|
|
9
9
|
- Smart skip of Odoo core modules
|
|
10
10
|
- Branch selection for cloning
|
|
11
|
+
- Post-push command execution on the remote server
|
|
12
|
+
- Built-in SSH key generation
|
|
11
13
|
- Helpful and colorful CLI output
|
|
12
|
-
- Built using [Typer](https://typer.tiangolo.com/) and Python 3.
|
|
14
|
+
- Built using [Typer](https://typer.tiangolo.com/) and Python 3.7+
|
|
13
15
|
|
|
14
16
|
---
|
|
15
17
|
|
|
16
18
|
## 📦 Installation
|
|
17
19
|
|
|
18
20
|
```bash
|
|
19
|
-
git clone https://github.com/
|
|
21
|
+
git clone https://github.com/anomalyco/odooflow-cli.git
|
|
20
22
|
cd odooflow-cli
|
|
21
23
|
pip install .
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
Or install directly from source for development:
|
|
26
|
+
Or install directly from source for development (with test/lint extras):
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
|
-
pip install -e .
|
|
29
|
+
pip install -e .[dev]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Install from PyPI (once published):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install odooflow-cli
|
|
28
36
|
```
|
|
29
37
|
|
|
30
38
|
---
|
|
@@ -49,11 +57,18 @@ odooflow --help
|
|
|
49
57
|
|
|
50
58
|
### Clone Command Options:
|
|
51
59
|
|
|
52
|
-
| Flag
|
|
53
|
-
|
|
54
|
-
| `--url`
|
|
55
|
-
| `--branch
|
|
56
|
-
| `--
|
|
60
|
+
| Flag | Description |
|
|
61
|
+
|----------------|--------------------------------------------------------------------------------------------------------|
|
|
62
|
+
| `--url` | Full HTTP URL of the module repo |
|
|
63
|
+
| `--branch`/`-b`| (Optional) Git branch to clone from |
|
|
64
|
+
| `--depth`/`-d` | Max dependency depth to clone. `1` clones only the target module, `2` clones target + immediate deps, etc. (default: `1`) |
|
|
65
|
+
|
|
66
|
+
### Push Command Options:
|
|
67
|
+
|
|
68
|
+
| Flag | Description |
|
|
69
|
+
|-----------------|-----------------------------------------------------------------------------|
|
|
70
|
+
| `--remote-only` | Skip Git push and only upload to server |
|
|
71
|
+
| `--exec` | Custom shell command to execute on the server after pushing |
|
|
57
72
|
|
|
58
73
|
### 🔍 Examples:
|
|
59
74
|
|
|
@@ -69,10 +84,34 @@ Clone with specific branch:
|
|
|
69
84
|
odooflow clone --url https://gitlab.com/mygroup/my_odoo_module.git --branch 17.0
|
|
70
85
|
```
|
|
71
86
|
|
|
72
|
-
Clone
|
|
87
|
+
Clone target + immediate dependencies (depth 2):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
odooflow clone --url https://gitlab.com/mygroup/my_odoo_module.git --depth 2
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Clone the full dependency tree (depth 5):
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
odooflow clone --url https://gitlab.com/mygroup/my_odoo_module.git --depth 5
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Push current branch to Git and upload to the configured server:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
odooflow push
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Push and execute a custom command on the remote server after upload:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
odooflow push --exec "sudo systemctl restart odoo"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Skip Git push, only upload to server:
|
|
73
112
|
|
|
74
113
|
```bash
|
|
75
|
-
odooflow
|
|
114
|
+
odooflow push --remote-only
|
|
76
115
|
```
|
|
77
116
|
|
|
78
117
|
---
|
|
@@ -100,7 +139,7 @@ odooflow/
|
|
|
100
139
|
├── tests/
|
|
101
140
|
├── README.md
|
|
102
141
|
├── requirements.txt
|
|
103
|
-
├──
|
|
142
|
+
├── pyproject.toml
|
|
104
143
|
└── LICENSE
|
|
105
144
|
```
|
|
106
145
|
|
|
@@ -128,7 +167,7 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
|
|
|
128
167
|
|
|
129
168
|
Move this CLI into fully-integrated Odoo environment, using Odoo, users can create issues, add the amount of details, then sync these issues with Odooflow.
|
|
130
169
|
|
|
131
|
-
We can do integration with any code agent to help developers to achieve these issues
|
|
170
|
+
We can do integration with any code agent to help developers to achieve these issues
|
|
132
171
|
|
|
133
172
|
same thing for pipelines, I think it will be amazing if developers can build pipelines using Odoo, then apply the same pipelines using Odooflow.
|
|
134
173
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odooflow-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: OdooFlow CLI - streamline your Odoo development workflow
|
|
5
5
|
Author: Mohammad A. Hamdan
|
|
6
6
|
License: MIT
|
|
@@ -33,31 +33,39 @@ Dynamic: license-file
|
|
|
33
33
|
|
|
34
34
|
# 🌀 Odooflow CLI
|
|
35
35
|
|
|
36
|
-
**
|
|
36
|
+
**OdooFlow CLI** is a command-line interface tool designed to streamline the development workflow for Odoo projects. It helps clone Odoo modules (and their dependencies), handles GitLab lookups, and provides bounded recursive cloning via a configurable depth.
|
|
37
37
|
|
|
38
38
|
## 🚀 Features
|
|
39
39
|
|
|
40
40
|
- Clone an Odoo module by Git URL
|
|
41
|
-
- Recursively resolve and clone
|
|
41
|
+
- Recursively resolve and clone dependencies up to a configurable depth
|
|
42
42
|
- Smart skip of Odoo core modules
|
|
43
43
|
- Branch selection for cloning
|
|
44
|
+
- Post-push command execution on the remote server
|
|
45
|
+
- Built-in SSH key generation
|
|
44
46
|
- Helpful and colorful CLI output
|
|
45
|
-
- Built using [Typer](https://typer.tiangolo.com/) and Python 3.
|
|
47
|
+
- Built using [Typer](https://typer.tiangolo.com/) and Python 3.7+
|
|
46
48
|
|
|
47
49
|
---
|
|
48
50
|
|
|
49
51
|
## 📦 Installation
|
|
50
52
|
|
|
51
53
|
```bash
|
|
52
|
-
git clone https://github.com/
|
|
54
|
+
git clone https://github.com/anomalyco/odooflow-cli.git
|
|
53
55
|
cd odooflow-cli
|
|
54
56
|
pip install .
|
|
55
57
|
```
|
|
56
58
|
|
|
57
|
-
Or install directly from source for development:
|
|
59
|
+
Or install directly from source for development (with test/lint extras):
|
|
58
60
|
|
|
59
61
|
```bash
|
|
60
|
-
pip install -e .
|
|
62
|
+
pip install -e .[dev]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Install from PyPI (once published):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install odooflow-cli
|
|
61
69
|
```
|
|
62
70
|
|
|
63
71
|
---
|
|
@@ -82,11 +90,18 @@ odooflow --help
|
|
|
82
90
|
|
|
83
91
|
### Clone Command Options:
|
|
84
92
|
|
|
85
|
-
| Flag
|
|
86
|
-
|
|
87
|
-
| `--url`
|
|
88
|
-
| `--branch
|
|
89
|
-
| `--
|
|
93
|
+
| Flag | Description |
|
|
94
|
+
|----------------|--------------------------------------------------------------------------------------------------------|
|
|
95
|
+
| `--url` | Full HTTP URL of the module repo |
|
|
96
|
+
| `--branch`/`-b`| (Optional) Git branch to clone from |
|
|
97
|
+
| `--depth`/`-d` | Max dependency depth to clone. `1` clones only the target module, `2` clones target + immediate deps, etc. (default: `1`) |
|
|
98
|
+
|
|
99
|
+
### Push Command Options:
|
|
100
|
+
|
|
101
|
+
| Flag | Description |
|
|
102
|
+
|-----------------|-----------------------------------------------------------------------------|
|
|
103
|
+
| `--remote-only` | Skip Git push and only upload to server |
|
|
104
|
+
| `--exec` | Custom shell command to execute on the server after pushing |
|
|
90
105
|
|
|
91
106
|
### 🔍 Examples:
|
|
92
107
|
|
|
@@ -102,10 +117,34 @@ Clone with specific branch:
|
|
|
102
117
|
odooflow clone --url https://gitlab.com/mygroup/my_odoo_module.git --branch 17.0
|
|
103
118
|
```
|
|
104
119
|
|
|
105
|
-
Clone
|
|
120
|
+
Clone target + immediate dependencies (depth 2):
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
odooflow clone --url https://gitlab.com/mygroup/my_odoo_module.git --depth 2
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Clone the full dependency tree (depth 5):
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
odooflow clone --url https://gitlab.com/mygroup/my_odoo_module.git --depth 5
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Push current branch to Git and upload to the configured server:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
odooflow push
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Push and execute a custom command on the remote server after upload:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
odooflow push --exec "sudo systemctl restart odoo"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Skip Git push, only upload to server:
|
|
106
145
|
|
|
107
146
|
```bash
|
|
108
|
-
odooflow
|
|
147
|
+
odooflow push --remote-only
|
|
109
148
|
```
|
|
110
149
|
|
|
111
150
|
---
|
|
@@ -133,7 +172,7 @@ odooflow/
|
|
|
133
172
|
├── tests/
|
|
134
173
|
├── README.md
|
|
135
174
|
├── requirements.txt
|
|
136
|
-
├──
|
|
175
|
+
├── pyproject.toml
|
|
137
176
|
└── LICENSE
|
|
138
177
|
```
|
|
139
178
|
|
|
@@ -161,7 +200,7 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
|
|
|
161
200
|
|
|
162
201
|
Move this CLI into fully-integrated Odoo environment, using Odoo, users can create issues, add the amount of details, then sync these issues with Odooflow.
|
|
163
202
|
|
|
164
|
-
We can do integration with any code agent to help developers to achieve these issues
|
|
203
|
+
We can do integration with any code agent to help developers to achieve these issues
|
|
165
204
|
|
|
166
205
|
same thing for pipelines, I think it will be amazing if developers can build pipelines using Odoo, then apply the same pipelines using Odooflow.
|
|
167
206
|
|
|
@@ -39,14 +39,14 @@ class TestInitModuleEnv:
|
|
|
39
39
|
"init",
|
|
40
40
|
"--author", "Test Author",
|
|
41
41
|
"--odoo-version", "17.0",
|
|
42
|
-
"--license", "MIT",
|
|
42
|
+
"--license-name", "MIT",
|
|
43
43
|
"--website", "https://test.com"
|
|
44
44
|
])
|
|
45
45
|
assert result.exit_code == 0
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
env_path = temp_dir / ".odooflow.env.json"
|
|
48
48
|
assert env_path.exists()
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
env = json.loads(env_path.read_text())
|
|
51
51
|
assert env["author"] == "Test Author"
|
|
52
52
|
assert env["version"] == "17.0"
|
|
@@ -64,10 +64,10 @@ class TestConfigManager:
|
|
|
64
64
|
assert config == test_config
|
|
65
65
|
|
|
66
66
|
def test_load_config_invalid_json(self, mock_home, temp_config_file):
|
|
67
|
-
"""Test loading config with invalid JSON."""
|
|
67
|
+
"""Test loading config with invalid JSON exits with an error (no silent fallback)."""
|
|
68
68
|
temp_config_file.write_text("invalid json")
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
with pytest.raises(typer.Exit):
|
|
70
|
+
load_config()
|
|
71
71
|
|
|
72
72
|
def test_save_config(self, mock_home, temp_config_file):
|
|
73
73
|
"""Test saving config to file."""
|
|
@@ -2,6 +2,7 @@ import json
|
|
|
2
2
|
import pytest
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from unittest.mock import patch
|
|
5
|
+
import typer
|
|
5
6
|
|
|
6
7
|
from odooflow.utils.env import (
|
|
7
8
|
read_manifest,
|
|
@@ -37,28 +38,27 @@ class TestEnvUtils:
|
|
|
37
38
|
assert manifest == {"name": "test_module", "version": "16.0"}
|
|
38
39
|
|
|
39
40
|
def test_read_manifest_invalid_syntax(self, temp_manifest_file):
|
|
40
|
-
"""Test reading manifest with invalid syntax."""
|
|
41
|
+
"""Test reading manifest with invalid syntax exits with an error (no silent fallback)."""
|
|
41
42
|
temp_manifest_file.write_text("invalid python")
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
|
|
44
|
+
with pytest.raises(typer.Exit):
|
|
45
|
+
read_manifest(temp_manifest_file)
|
|
45
46
|
|
|
46
47
|
def test_read_manifest_empty_file(self, temp_manifest_file):
|
|
47
|
-
"""Test reading an empty manifest file."""
|
|
48
|
+
"""Test reading an empty manifest file exits (SyntaxError/ValueError is not silently swallowed)."""
|
|
48
49
|
temp_manifest_file.write_text("")
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
|
|
51
|
+
with pytest.raises(typer.Exit):
|
|
52
|
+
read_manifest(temp_manifest_file)
|
|
52
53
|
|
|
53
54
|
def test_read_manifest_security(self, temp_manifest_file):
|
|
54
55
|
"""Test that eval is not used (security check)."""
|
|
55
56
|
# This should not execute arbitrary code
|
|
56
57
|
malicious_content = "__import__('os').system('echo malicious')"
|
|
57
58
|
temp_manifest_file.write_text(malicious_content)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
assert manifest == {}
|
|
59
|
+
|
|
60
|
+
with pytest.raises(typer.Exit):
|
|
61
|
+
read_manifest(temp_manifest_file)
|
|
62
62
|
|
|
63
63
|
def test_write_env_file(self, temp_env_file):
|
|
64
64
|
"""Test writing env file."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|