Commit 4a6892a6 authored by Saci Pererê's avatar Saci Pererê :speech_balloon:
Browse files

Revert "build: Cria definições de CI"

This reverts commit 4d32582a.
Showing with 297 additions and 914 deletions
+297 -914
{"name":"balaio","path":"balaio-MZMAcyg","smid":"MZMAcyg","slug":"balaio-MZMAcyg","balaio_smid":null,"mucua_smid":null,"content":[],"application":"root","created":"2024-02-25T15:07:04.845424","creator":"mocambola","last_update":"2024-02-25T15:07:04.845466","is_public":true,"is_local":false,"is_requested":false,"default_mucua":null}
\ No newline at end of file
config annex.largefiles=nothing
[datalad "dataset"]
id = 44f273b9-b1d6-49b4-b51d-73d27c0f6764
* annex.backend=MD5E
**/.git* annex.largefiles=nothing
* annex.largefiles=((mimeencoding=binary)and(largerthan=0))
**/*.md annex.largefiles=anything
\ No newline at end of file
......@@ -2,5 +2,3 @@
**.pyc
venv-bbx/
.ropeproject
*.rej
**.local
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# https://pip.pypa.io/en/stable/topics/caching/
cache:
paths:
- .cache/pip
before_script:
- poetry run python --version
- make
unit-tests:
stage: test
script:
- echo "Python Unit Tests"
- make test
deploy-dev:
stage: deploy
script:
- echo "Deploy stage"
# - ansible-playbook ...
......@@ -44,8 +44,9 @@ archdeps:
@echo "certifique-se que seu sistema é baseado em archlinux para continuar"
pacman -S python-virtualenv git-annex
# TODO Target: Executa os testes
test:
poetry run pytest
@echo "TODO: executar os testes"
# TODO Target: Executa a instalação
install:
......
#!/usr/bin/env python3
"""Grupo de rotas para autenticação."""
from typing import Annotated
from fastapi import APIRouter, Body, Form
from fastapi import APIRouter, Body, Depends, Form
from baobaxia.core.baobaxia_api import bbx as bbx_default
# from loguru import logger
from baobaxia.core.baobaxia_api import bbx
router = APIRouter(tags=["Autenticação"])
@router.post("/auth", response_model=dict, summary="Autenticar mocambola")
async def authenticate(
*,
username: str = Body(...),
password: str = Body(...),
bbx: Annotated[str, Depends(bbx_default)],
):
async def authenticate(*, username: str = Body(...), password: str = Body(...)):
"""Autenticar mocambola."""
return bbx.baobaxia.authenticate(username, password)
@router.get("/session", summary="Sessão ativa de mocambola")
async def get_session(
*,
token: str,
bbx: Annotated[str, Depends(bbx_default)],
):
async def get_session(*, token: str):
"""Retorna a sessão ativa de mocambola."""
return bbx.baobaxia.get_session(token)
@router.post("/recover", response_model=dict, summary="Recuperar acesso de mocambola")
async def recover(
*,
username: str = Form(...),
recovery_answer: str = Form(...),
bbx: Annotated[str, Depends(bbx_default)],
):
async def recover(*, username: str = Form(...), recovery_answer: str = Form(...)):
"""Recuperar mocambola."""
return bbx.baobaxia.authenticate(username, recovery_answer=recovery_answer)
#!/usr/bin/env python3
from typing import List, Optional
from fastapi import APIRouter, Header
from typing import Optional, List
from fastapi import Header, APIRouter
from baobaxia.root import Baobaxia
class BaobaxiaAPI:
def __init__(self, bbx: Baobaxia = None):
def __init__(self):
"""Inicializa Baobaxia wrapper."""
if bbx is None:
self.baobaxia = Baobaxia()
else:
self.baobaxia = bbx
def __call__(self):
return self
self.baobaxia = Baobaxia()
def extract_smid(self, slug_smid: str):
# TODO: Usar split fica mais simples de entender
......
#!/usr/bin/env python3
from pathlib import Path
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
app_name: str = "Baobáxia API"
bbx_conf_default: Path = Path.home().joinpath(".baobaxia.conf")
settings = Settings()
#!/usr/bin/env python3
import argparse
import os
from configparser import ConfigParser
from getpass import getpass
from pathlib import Path
from baobaxia.saberes import (
Balaio,
Mocambola,
Mucua,
from .saberes import (
SaberesConfig,
Saber,
SaberesDataset,
SaberesDataStore,
Balaio,
Mucua,
Mocambola,
)
from baobaxia.sankofa import Sankofa
from loguru import logger
from .sankofa import Sankofa
from pathlib import Path
from configparser import ConfigParser
import argparse, os
from getpass import getpass
parser = argparse.ArgumentParser("criar_mucua")
parser.add_argument(
"--path",
help="Caminho absoluto da pasta para os dados do Baobáxia",
type=str,
"--path", help="Caminho absoluto da pasta para os dados do Baobáxia", type=str
)
parser.add_argument("--balaio", help="Nome do Balaio", type=str)
parser.add_argument(
......@@ -31,14 +31,10 @@ parser.add_argument("--email", help="Email do Mocambola", type=str)
parser.add_argument("--password", help="Password para o Mocambola", type=str)
parser.add_argument("--smid_len", help="Numero de carateres para os IDs", type=int)
parser.add_argument(
"--slug_name_len",
help="Numero de carateres para os nomes abreviados",
type=int,
"--slug_name_len", help="Numero de carateres para os nomes abreviados", type=int
)
parser.add_argument(
"--slug_smid_len",
help="Numero de carateres para os IDs abreviados",
type=int,
"--slug_smid_len", help="Numero de carateres para os IDs abreviados", type=int
)
parser.add_argument(
"--slug_sep", help="Caracter separador para o identificativo", type=str
......@@ -48,36 +44,21 @@ parser.add_argument(
args = parser.parse_args()
def install_interactive(configure: bool = True):
def install_interactive():
print("Instalador do Baobáxia")
print("Entre com os dados do ambiente")
configure = input("Deseja configurar a Mucua? [S/n] ")
logger.debug(f"Configuração? {configure}")
if configure in ["", "S", "s"]:
path = input("Caminho do diretório de dados: ")
balaio = input("Nome do balaio: ")
mucua = input("Nome da mucua: ")
print("Entre com os dados do mocambola")
mocambola = input("Nome de usuário: ")
email = input("E-mail: ")
password = getpass("Senha: ")
print("Entre com as configurações de chave primária")
smid_len = input("Tamanho da chave aleatória (smid) ")
slug_name_len = int(input("Tamanho do nome na chave primária: "))
slug_smid_len = int(input("Tamanho da chave aleatória na chave primária: "))
slug_sep = input("Separador da chave primária: ")
else:
path = "./tmp/instaler"
balaio = "tmp_balaio"
mucua = "tmp_mucua"
mocambola = "tmp_mocambola"
email = "mocambola@mucua.balaio"
password = "tmp_password"
smid_len = 7
slug_name_len = 7
slug_smid_len = 7
slug_sep = "-"
path = input("Caminho do diretório de dados: ")
balaio = input("Nome do balaio: ")
mucua = input("Nome da mucua: ")
print("Entre com os dados do mocambola")
mocambola = input("Nome de usuário: ")
email = input("E-mail: ")
password = getpass("Senha: ")
print("Entre com as configurações de chave primária")
smid_len = input("Tamanho da chave aleatória (smid) ")
slug_name_len = int(input("Tamanho do nome na chave primária: "))
slug_smid_len = int(input("Tamanho da chave aleatória na chave primária: "))
slug_sep = input("Separador da chave primária: ")
install(
path=path,
balaio=balaio,
......@@ -103,7 +84,7 @@ def install(
smid_len: int,
slug_name_len: int,
slug_smid_len: int,
slug_sep: str,
slug_sep: str
):
"""Instalador do Baobáxia
......@@ -175,9 +156,7 @@ def install(
balaio_saber.path / mucua_saber.path / mocambola_saber.path
)
Sankofa.create_balaio(
balaio=balaio_saber.slug,
description=balaio_saber.slug,
config=config,
balaio=balaio_saber.slug, description=balaio_saber.slug, config=config
)
mucua_saber.path = balaio_saber.slug / mucua_saber.path
......@@ -217,7 +196,7 @@ def get_dummy_config(
smid_len: int = 7,
slug_name_len: int = 12,
slug_smid_len: int = 7,
slug_sep="_",
slug_sep="_"
):
return SaberesConfig(
data_path=data_path,
......@@ -238,7 +217,7 @@ def get_dummy_datastore(
smid_len: int = 7,
slug_name_len: int = 12,
slug_smid_len: int = 7,
slug_sep="_",
slug_sep="_"
):
return SaberesDataStore(
get_dummy_config(
......
#!/usr/bin/env python3
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
......@@ -18,7 +18,7 @@ if ALLOW_CORS:
allow_headers=["*"],
)
app.include_router(api_router, prefix="/api/v2")
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000, reload=True)
# api.mount("/", StaticFiles(directory="static"), name="static")
app.include_router(api_router, prefix="/api/v2")
#!/usr/bin/env python3
from pathlib import Path
from datetime import datetime
import os
import shutil
from collections.abc import MutableMapping
from configparser import ConfigParser
from datetime import datetime
from math import ceil
from pathlib import Path
from typing import Any, List, Optional
from fastapi import HTTPException
from loguru import logger
from typing import Optional, List, Any
from pydantic import BaseModel
from fastapi import HTTPException
from configparser import ConfigParser
from .sankofa import Sankofa
from .util import str_to_hash
from .saberes import (
Saber,
Balaio,
Mocambola,
Mucua,
Pedido,
Rota,
Saber,
Mocambola,
SaberesConfig,
SaberesDataStore,
Pedido,
Rota,
)
from .sankofa import Sankofa
from .util import str_to_hash
class BaobaxiaError(Exception):
......@@ -34,7 +33,6 @@ class BaobaxiaError(Exception):
class SessionNotFound(BaobaxiaError):
pass
class SessionExpired(BaobaxiaError):
pass
......@@ -105,7 +103,6 @@ class SessionDict(MutableMapping):
self[key] = session
return session
else:
logger.debug(f"Tokens de sessão: {self._by_token.keys()}")
if key not in self._by_token:
raise HTTPException(status_code=403, detail="Sessão inválida")
return self._by_token[key].keep_alive()
......@@ -118,7 +115,6 @@ class SessionDict(MutableMapping):
raise HTTPException(status_code=403, detail="Mocambola inválido")
if isinstance(key, str) and value.token != key:
raise HTTPException(status_code=403, detail="Token inválido")
logger.debug(f"Atribuindo Sessão: {key}: {value}")
self._by_mocambola[value.mocambola.username] = value
self._by_token[value.token] = value
......@@ -146,18 +142,14 @@ class Baobaxia:
self.datastore = SaberesDataStore(self.config)
self.reload_balaios()
self._sessions = SessionDict()
logger.debug(f"Sessões ativas: {self._sessions._by_token.keys()}")
def reload_balaios(self):
logger.debug(f"Baobáxia config: {self.config}")
balaios_list = self.datastore.create_balaio_dataset().find_and_collect("*/")
self._balaios = {}
self._mucuas_por_balaio = {}
self._mocambolas_por_mucua = {}
self._roles_por_mocambolas = {}
logger.debug(f"Balaios List: {balaios_list}")
for balaio in balaios_list:
logger.debug(f"Balaio: {balaio}")
self._balaios[balaio.smid] = balaio
self._mucuas_por_balaio[balaio.smid] = {}
self._mocambolas_por_mucua[balaio.smid] = {}
......@@ -179,7 +171,7 @@ class Baobaxia:
self._roles_por_mocambolas[balaio.smid][mocambola.username][
"roles"
] = mocambola.roles
logger.info("Sai do loop dos balaios")
self.default_balaio = self._balaios[self.config.default_balaio]
self.default_mucua = self._mucuas_por_balaio[self.config.default_balaio][
......@@ -213,7 +205,7 @@ class Baobaxia:
smid: Optional[str] = None,
name: str,
default_mucua: Optional[str] = None,
token: str,
token: str
):
session = self._sessions[token]
dataset = self.datastore.create_balaio_dataset(
......@@ -344,7 +336,7 @@ class Baobaxia:
name: Optional[str] = None,
mucua_smid: Optional[str] = None,
mucua: Optional[Mucua] = None,
token: str,
token: str
):
session = self._sessions[token]
dataset = self.datastore.create_mucua_dataset(
......@@ -436,7 +428,7 @@ class Baobaxia:
mocambola: Mocambola,
recovery_answer: Optional[str] = None,
*,
token: str,
token: str
):
session = self._sessions[token]
dataset = self.datastore.create_dataset(
......@@ -655,7 +647,7 @@ class Baobaxia:
patterns: List[str],
field_name: Optional[str] = None,
list_field_name: Optional[str] = None,
indexes_names: List[str] = [],
indexes_names: List[str] = []
):
if field_name is None:
field_name = model.__name__.lower()
......@@ -844,7 +836,7 @@ class Baobaxia:
mucua_smid: str,
username: str,
password: Optional[str] = None,
recovery_answer: Optional[str] = None,
recovery_answer: Optional[str] = None
):
mocambola = self._mocambolas_por_mucua[balaio_smid][mucua_smid][username]
str_to_check = None
......@@ -903,7 +895,7 @@ class Baobaxia:
new_password: str,
password: Optional[str] = None,
recovery_answer: Optional[str] = None,
token: str,
token: str
):
session = self._sessions[token].keep_alive()
mocambola = session.mocambola
......@@ -936,7 +928,7 @@ class Baobaxia:
new_recovery_answer: str,
password: Optional[str] = None,
recovery_answer: Optional[str] = None,
token: str,
token: str
):
session = self._sessions[token].keep_alive()
mocambola = session.mocambola
......
#!/usr/bin/env python3
from datetime import datetime
import os
from pathlib import Path
from typing import Dict, List, Optional
from datetime import datetime
from typing import Dict, Union, List, Optional, Any
import shortuuid
from pydantic import BaseModel, EmailStr
from pydantic_settings import BaseSettings
from slugify import slugify
import json
from pydantic import BaseModel, EmailStr, ValidationError, validator
from .util import GeoLocation
NoneType = type(None)
class SaberesConfig(BaseSettings):
class SaberesConfig(BaseModel):
"""
Modelo de configuração do Saber.
Essa classe é usada para armazenar algumas configurações de base do Baobáxia.
......@@ -22,15 +27,14 @@ class SaberesConfig(BaseSettings):
data_path: Path
saber_file_ext: str = ".baobaxia"
default_balaio: str = "default_balaio"
default_mucua: str = "default_mucua"
default_balaio: str
default_mucua: str
default_ttl: int = 3
slug_sep: str = "_"
smid_len: int = 13
slug_smid_len: int = 7
slug_name_len: int = 7
slug_sep: str = "_"
class Saber(BaseModel):
......
import pytest
from .test_env import BaseBaobaxiaTest
@pytest.fixture(autouse=True, scope="session")
def base():
b = BaseBaobaxiaTest()
b.init_balaio_local()
from baobaxia.saberes import Balaio, Mucua, Mocambola, SaberesDataStore
from baobaxia.sankofa import Sankofa
from .test_env import BaseBaobaxiaTest, DataTestModel
from pathlib import Path
from pydantic import BaseModel
from datalad.tests.utils import ok_file_under_git
class TestSankofa(BaseBaobaxiaTest):
balaio2_name = "rede-mocambos"
balaio2_smid = "892xa89sajka"
balaio2_slug = balaio2_name + "_" + balaio2_smid
balaio2_path = BaseBaobaxiaTest.data_path / balaio2_slug
balaio2_filepath = balaio2_path / ".baobaxia"
balaio2_mucua_path = balaio2_path / BaseBaobaxiaTest.mucua_slug
balaio2_mucua_filepath = balaio2_mucua_path / ".baobaxia"
balaio2 = Balaio(
path=Path(balaio2_slug),
name=balaio2_name,
smid=balaio2_smid,
slug=balaio2_slug,
creator=BaseBaobaxiaTest.mocambola_username,
created=BaseBaobaxiaTest.default_date,
last_update=BaseBaobaxiaTest.default_date,
mucua_padrao=BaseBaobaxiaTest.mucua_slug,
)
balaio2_mucua = Mucua(
path=Path(BaseBaobaxiaTest.mucua_slug),
name=BaseBaobaxiaTest.mucua_name,
smid=BaseBaobaxiaTest.mucua_smid,
slug=BaseBaobaxiaTest.mucua_slug,
creator=BaseBaobaxiaTest.mocambola_username,
created=BaseBaobaxiaTest.default_date,
last_update=BaseBaobaxiaTest.default_date,
balaio=balaio2_slug,
)
content_text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz"
content_byte = bytes([100, 24, 255])
nova_mucua_slug = "abdias-nascimento_LZsgH"
nova_mucua_remote = "ssh://exu@adbias.mocambos.net:2067/data/bbx/balaios/acervo-patrimonio-red_jNXhc"
def test_add(self):
datastore = SaberesDataStore(self.config)
balaio_dataset = datastore.create_balaio_dataset(
mocambola=self.mocambola_username
)
balaio_dataset.settle(self.balaio2)
Sankofa.create_balaio(
balaio=self.balaio2_slug, description=self.balaio2_slug, config=self.config
)
mucua_dataset = datastore.create_mucua_dataset(
balaio_smid=self.balaio2_smid, mocambola=self.mocambola_username
)
mucua_dataset.settle(self.balaio2_mucua)
Sankofa.add(
saberes=[self.balaio2_mucua], mocambola=self.mocambola, config=self.config
)
tests_fullpath2 = (
self.data_path / self.balaio2_slug / self.mucua_slug / self.tests_path
)
if not tests_fullpath2.exists():
tests_fullpath2.mkdir()
dataset = datastore.create_dataset(
model=DataTestModel,
balaio_smid=self.balaio_smid,
mucua_smid=self.mucua_smid,
mocambola=self.mocambola_username,
)
dataset2 = datastore.create_dataset(
model=DataTestModel,
balaio_smid=self.balaio2_smid,
mucua_smid=self.mucua_smid,
mocambola=self.mocambola_username,
)
self.saber_dir = DataTestModel(
name=self.saber_dir_name,
path=self.tests_path,
message=self.saber_dir_message,
any_int=self.saber_dir_any_int,
)
self.saber_dir = dataset.settle(self.saber_dir)
self.saber_file1 = DataTestModel(
name=self.saber_file1_name,
path=self.saber_dir.path,
message=self.saber_file1_message,
any_int=self.saber_file1_any_int,
content=[self.saber_file1_content],
)
self.saber_file1 = dataset.settle(self.saber_file1)
self.saber_file2 = DataTestModel(
name=self.saber_file2_name,
path=self.saber_dir.path,
message=self.saber_file2_message,
any_int=self.saber_file2_any_int,
)
self.saber_file2.content.append(self.saber_file2_content)
self.saber_file2 = dataset.settle(self.saber_file2)
saber_file1_content_path = (
self.config.data_path
/ self.saber_file1.balaio
/ self.saber_file1.mucua
/ self.saber_file1.path
/ self.saber_file1.content[0]
)
saber_file2_content_path = (
self.config.data_path
/ self.saber_file2.balaio
/ self.saber_file2.mucua
/ self.saber_file2.path
/ self.saber_file2.content[0]
)
with open(saber_file1_content_path, "w") as ft:
ft.write(self.content_text)
with open(saber_file2_content_path, "wb") as fb:
fb.write(self.content_byte)
Sankofa.add(
saberes=[self.saber_dir, self.saber_file1, self.saber_file2],
mocambola=self.mocambola,
config=self.config,
)
self.saber_dir2 = DataTestModel(
name=self.saber_dir_name,
path=self.tests_path,
message=self.saber_dir_message,
any_int=self.saber_dir_any_int,
)
self.saber_dir2 = dataset2.settle(self.saber_dir2)
self.saber_file3 = DataTestModel(
name=self.saber_file1_name,
path=self.saber_dir2.path,
message=self.saber_file1_message,
any_int=self.saber_file1_any_int,
content=[self.saber_file1_content],
)
self.saber_file3 = dataset2.settle(self.saber_file3)
self.saber_file4 = DataTestModel(
name=self.saber_file2_name,
path=self.saber_dir2.path,
message=self.saber_file2_message,
any_int=self.saber_file2_any_int,
)
self.saber_file4.content.append(self.saber_file2_content)
self.saber_file4 = dataset2.settle(self.saber_file4)
saber_file3_content_path = (
self.config.data_path
/ self.saber_file3.balaio
/ self.saber_file3.mucua
/ self.saber_file3.path
/ self.saber_file3.content[0]
)
saber_file4_content_path = (
self.config.data_path
/ self.saber_file4.balaio
/ self.saber_file4.mucua
/ self.saber_file4.path
/ self.saber_file4.content[0]
)
with open(saber_file3_content_path, "w") as ft:
ft.write(self.content_text)
with open(saber_file4_content_path, "wb") as fb:
fb.write(self.content_byte)
Sankofa.add(
saberes=[self.saber_dir2, self.saber_file3, self.saber_file4],
mocambola=self.mocambola,
config=self.config,
)
assert (
ok_file_under_git(
self.config.data_path / self.saber_file1.balaio,
str(
self.saber_file1.mucua
/ self.saber_file1.path
/ self.config.saber_file_ext
),
)
== None
)
assert (
ok_file_under_git(
self.config.data_path / self.saber_file2.balaio,
str(
self.saber_file2.mucua
/ self.saber_file2.path
/ self.config.saber_file_ext
),
)
== None
)
assert (
ok_file_under_git(
self.config.data_path / self.saber_file3.balaio,
str(
self.saber_file3.mucua
/ self.saber_file3.path
/ self.config.saber_file_ext
),
)
== None
)
assert (
ok_file_under_git(
self.config.data_path / self.saber_file4.balaio,
str(
self.saber_file4.mucua
/ self.saber_file4.path
/ self.config.saber_file_ext
),
)
== None
)
assert (
ok_file_under_git(
self.config.data_path / self.saber_file1.balaio,
str(
self.saber_file1.mucua
/ self.saber_file1.path
/ self.saber_file1.content[0]
),
)
== None
)
assert (
ok_file_under_git(
self.config.data_path / self.saber_file2.balaio,
str(
self.saber_file2.mucua
/ self.saber_file2.path
/ self.saber_file2.content[0]
),
annexed=True,
)
== None
)
assert (
ok_file_under_git(
self.config.data_path / self.saber_file3.balaio,
str(
self.saber_file3.mucua
/ self.saber_file3.path
/ self.saber_file3.content[0]
),
)
== None
)
assert (
ok_file_under_git(
self.config.data_path / self.saber_file4.balaio,
str(
self.saber_file4.mucua
/ self.saber_file4.path
/ self.saber_file4.content[0]
),
annexed=True,
)
== None
)
def test_remove(self):
datastore = SaberesDataStore(self.config)
dataset = datastore.create_dataset(
model=DataTestModel,
balaio_smid=self.balaio_smid,
mucua_smid=self.mucua_smid,
mocambola=self.mocambola_username,
)
saber_files = dataset.find_and_collect("tests/*/*")
sf1 = (
self.config.data_path
/ saber_files[0].balaio
/ saber_files[0].mucua
/ saber_files[0].path
)
assert sf1.exists()
Sankofa.remove(
saberes=[saber_files[0]], mocambola=self.mocambola, config=self.config
)
assert not sf1.exists()
def test_sync(self):
Sankofa.sync(balaio_slug=self.balaio_slug, config=self.config)
def test_mucua_remote_add_and_get(self):
Sankofa.mucua_remote_add(
balaio_slug=self.balaio_slug,
mucua_slug=self.nova_mucua_slug,
uri=self.nova_mucua_remote,
config=self.config,
)
remotes = Sankofa.mucua_remote_get(
balaio_slug=self.balaio_slug, config=self.config
)
assert self.nova_mucua_remote in remotes
def test_mucua_remote_del(self):
Sankofa.mucua_remote_del(
balaio_slug=self.balaio_slug,
mucua_slug=self.nova_mucua_slug,
config=self.config,
)
remotes = Sankofa.mucua_remote_get(
balaio_slug=self.balaio_slug, config=self.config
)
assert not remotes
def test_mucua_group_add_and_get(self):
novo_territorio = "territorio-taina"
Sankofa.mucua_group_add(
balaio_slug=self.balaio_slug,
mucua_slug=self.mucua_slug,
group=novo_territorio,
config=self.config,
)
groups = Sankofa.mucua_group_list(
balaio_slug=self.balaio_slug, mucua_slug=self.mucua_slug, config=self.config
)
assert novo_territorio in groups
def test_mucua_group_del(self):
novo_territorio = "territorio-taina"
Sankofa.mucua_group_del(
balaio_slug=self.balaio_slug,
mucua_slug=self.mucua_slug,
group=novo_territorio,
config=self.config,
)
groups = Sankofa.mucua_group_list(
balaio_slug=self.balaio_slug, mucua_slug=self.mucua_slug, config=self.config
)
assert not groups
This diff is collapsed.
......@@ -21,28 +21,17 @@ filetype = "^1.2.0"
unidecode = "^1.3.8"
datalad = "^0.19.6"
opencv-contrib-python-headless = "^4.9.0.80"
loguru = "^0.7.2"
pydantic-settings = "^2.2.1"
[tool.poetry.group.dev.dependencies]
pytest = "^8.0.1"
python-lsp-server = {extras = ["all"], version = "^1.10.0"}
python-lsp-black = "^2.0.0"
pre-commit = "^3.6.2"
httpx = "^0.27.0"
ptvsd = "^4.3.2"
[tool.black]
line-length = 88
[tool.pytest.ini_options]
testpaths = ["tests"]
norecursedirs = ["bin", "lib"]
log_level = "debug"
filterwarnings = [
"ignore::DeprecationWarning"
]
console_output_style = "count"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[pytest]
norecursedirs = bin lib
File moved
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment