Skip to content

Commit 7947690

Browse files
Add mimesis 4.1.2 to req and docker img. Resolved #36 B113 bandit report.
1 parent 2c31d6f commit 7947690

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

.gitlab/.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: registry.gitlab.com/aleksandr-kotlyar/python_and_gitlab/python-3.7.6-alpine-req:ver-13-ssl-fix
1+
image: registry.gitlab.com/aleksandr-kotlyar/python_and_gitlab/python-3.7.6-alpine-req:ver-14-mimesis-4.1.2
22

33
stages:
44
- build

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM python:3.7.6-alpine
2-
COPY requirements.txt /app/requirements.txt
32
WORKDIR /app
43
RUN apk --no-cache -U add curl \
54
gcc \
65
libc-dev \
76
libcrypto1.1=1.1.1g-r0 \
87
libssl1.1=1.1.1g-r0 \
98
sqlite-libs=3.30.1-r2
9+
COPY requirements.txt /app/requirements.txt
1010
RUN pip3 install --no-cache-dir -r requirements.txt

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ anybadge==1.6.2
1111
voluptuous==0.11.7
1212
pytest-voluptuous==1.1.0
1313
curlify==2.2.1
14-
webdriver_manager==2.3.0
14+
webdriver_manager==2.3.0
15+
mimesis==4.1.2

src/test/test_duplicates.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import logging
2-
import random
32
from collections import defaultdict
43
from logging import info
54

65
from assertpy import soft_assertions, assert_that
6+
from mimesis.random import Random
77
from pytest import mark
88

99
SOMETHING = [
@@ -36,14 +36,10 @@ def test_list_of_dictionaries_does_not_duplicate_by_some_key_value():
3636
f'key "{key}"" has duplicates "{new_some_view[key]}"').is_less_than_or_equal_to(1)
3737

3838

39-
def random_list(start, stop, _len):
40-
return [random.randint(start, stop) for i in range(_len)]
41-
42-
4339
@mark.parametrize('some_list', [
44-
([20, 30, 20, 30, 40, 50, 15, 11, 20, 40, 50, 15, 6, 7]),
45-
([9, 5, 4]),
46-
random_list(start=0, stop=4, _len=4),
40+
[20, 30, 20, 30, 40, 50, 15, 11, 20, 40, 50, 15, 6, 7],
41+
[9, 5, 4],
42+
Random().randints(20, 0, 10),
4743
])
4844
def test_list_doesnt_have_duplicates(some_list):
4945
some_list.sort()

0 commit comments

Comments
 (0)