diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 61b6a21..e72f2b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -279,7 +279,6 @@ class Example: """ ... return value - ``` Exemplo: diff --git a/CONTRIBUTING_EN.md b/CONTRIBUTING_EN.md index 1579e27..a93cdbe 100644 --- a/CONTRIBUTING_EN.md +++ b/CONTRIBUTING_EN.md @@ -209,7 +209,6 @@ class Example: """ ... return value - ``` Example: diff --git a/MAINTAINING.md b/MAINTAINING.md index 5f99446..d8b8471 100644 --- a/MAINTAINING.md +++ b/MAINTAINING.md @@ -145,25 +145,40 @@ Por exemplo, converter `"São Paulo"` para `"SP"`. from unittest import TestCase from brutils.ibge.uf import convert_text_to_uf + class TestUF(TestCase): def test_convert_text_to_uf(self): # Testes para nomes válidos - self.assertEqual(convert_text_to_uf('São Paulo'), "SP") - self.assertEqual(convert_text_to_uf('Rio de Janeiro'), "RJ") - self.assertEqual(convert_text_to_uf('Minas Gerais'), "MG") - self.assertEqual(convert_text_to_uf('Distrito Federal'), "DF") - self.assertEqual(convert_text_to_uf('são paulo'), "SP") # Teste com minúsculas - self.assertEqual(convert_text_to_uf('riO de janeiRo'), "RJ") # Teste com misturas de maiúsculas e minúsculas - self.assertEqual(convert_text_to_uf('minas gerais'), "MG") # Teste com minúsculas - self.assertEqual(convert_text_to_uf('sao paulo'), "SP") # Teste sem acento + self.assertEqual(convert_text_to_uf("São Paulo"), "SP") + self.assertEqual(convert_text_to_uf("Rio de Janeiro"), "RJ") + self.assertEqual(convert_text_to_uf("Minas Gerais"), "MG") + self.assertEqual(convert_text_to_uf("Distrito Federal"), "DF") + self.assertEqual( + convert_text_to_uf("são paulo"), "SP" + ) # Teste com minúsculas + self.assertEqual( + convert_text_to_uf("riO de janeiRo"), "RJ" + ) # Teste com misturas de maiúsculas e minúsculas + self.assertEqual( + convert_text_to_uf("minas gerais"), "MG" + ) # Teste com minúsculas + self.assertEqual( + convert_text_to_uf("sao paulo"), "SP" + ) # Teste sem acento # Testes para nomes inválidos - self.assertIsNone(convert_text_to_uf('Estado Inexistente')) # Nome não existe - self.assertIsNone(convert_text_to_uf('')) # Nome vazio - self.assertIsNone(convert_text_to_uf('123')) # Nome com números - self.assertIsNone(convert_text_to_uf('São Paulo SP')) # Nome com sigla incluída - self.assertIsNone(convert_text_to_uf('A')) # Nome com letra não mapeada - self.assertIsNone(convert_text_to_uf('ZZZ')) # Nome com mais de 2 letras + self.assertIsNone( + convert_text_to_uf("Estado Inexistente") + ) # Nome não existe + self.assertIsNone(convert_text_to_uf("")) # Nome vazio + self.assertIsNone(convert_text_to_uf("123")) # Nome com números + self.assertIsNone( + convert_text_to_uf("São Paulo SP") + ) # Nome com sigla incluída + self.assertIsNone(convert_text_to_uf("A")) # Nome com letra não mapeada + self.assertIsNone( + convert_text_to_uf("ZZZ") + ) # Nome com mais de 2 letras # implementar mais casos de teste aqui se necessário ``` diff --git a/poetry.lock b/poetry.lock index 534592e..e05922c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -162,30 +162,30 @@ six = ">=1.5" [[package]] name = "ruff" -version = "0.15.17" +version = "0.16.0" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" groups = ["dev"] files = [ - {file = "ruff-0.15.17-py3-none-linux_armv6l.whl", hash = "sha256:d9feddb927fc68bd295f5eebc587a7e42cfaf9b65f60ca4a2386febff575da8f"}, - {file = "ruff-0.15.17-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:25805a226d741c47d274a35ad5c10a7dde175fcddfa511d7cf3da0a21eb3eab7"}, - {file = "ruff-0.15.17-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f6ad73b14c2d18a3bf8ad7cb6974294d7f613a7898604826058e6ac64918ef4d"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ba0c1e4f95bcb3869d0d30cbd5917071ef2e28665abfec970cdab0492c713ed"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:81647960f10bff57d2e51cadd0c3950fe598400c852863a038720ef5b8cca91e"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0e01a84ddbc8c16c23055ba3924476850f1bbc1917cebbb9376665a63e74260d"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84fe9f653152f8f294f9f7e03bf3a453d8b4a27f7a59c78c8666167f2b17b96c"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8c0fe88a7676e7a05b73174d4d4a59cb2ac21ff8263583f87a81a6018475a978"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecfc3c7878fff94633ab0348524e093f9ce3243080416dd7d14f8ba400174719"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:b8461180b22420b1bdc289909410930761629fddf2a5aaf60fae1ab26cedc4c4"}, - {file = "ruff-0.15.17-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6eccbe50a038b503e7140b441aa9c7fc8c1f36edf23ebef9f4165c2f28f568b7"}, - {file = "ruff-0.15.17-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:382fc0521025f5a8ad447d8bdd523545d0d7646adb718eb1c2dac5065ec27c0f"}, - {file = "ruff-0.15.17-py3-none-musllinux_1_2_i686.whl", hash = "sha256:456d41fcd1b2777ad63f09a6e7121d43f7b688bbc76a800c10f7f8fb1f912c3f"}, - {file = "ruff-0.15.17-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b1a04bcc94ae6194e9db05d16ad31f298a7194bfbcb08258bbe589cee1d587b8"}, - {file = "ruff-0.15.17-py3-none-win32.whl", hash = "sha256:596065960ab1ff593f744220c9fe6580eda00a95003cffa9f4048bb5b1bf0392"}, - {file = "ruff-0.15.17-py3-none-win_amd64.whl", hash = "sha256:6769e5fa1710b179b92e0bfa5a51735b35baea9013dadb06d5f44cbcf9547084"}, - {file = "ruff-0.15.17-py3-none-win_arm64.whl", hash = "sha256:f3be1fbb34bcdfd146240d8fb92a709d4c2c8191348580a3c044ec60fa0b4456"}, - {file = "ruff-0.15.17.tar.gz", hash = "sha256:2ec446937fd16c8c4de2674a209cc5af64d9c6f17d21fbf1151054fa0bcf5219"}, + {file = "ruff-0.16.0-py3-none-linux_armv6l.whl", hash = "sha256:e5115729eb08c585e5121978ba5d5b60caeae394ce21b9fb5e6cd33a1c6c9b1e"}, + {file = "ruff-0.16.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3c954b1d580bfa035b41654f7858cc7e71d5fc3ac5b723dd62bd9133830ed522"}, + {file = "ruff-0.16.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e01c21d10eb1b29f47b7454e1f4056db9a3f0260c646aa88457c610291db9f81"}, + {file = "ruff-0.16.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e364e5ed22ed8dc05082fd78e35308618260907ac2d3c1d637b2e682415b6c9"}, + {file = "ruff-0.16.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d327b8fc113a1d4421a04f3839d3752057c8dd1ee320223a6f3f52d04ada462a"}, + {file = "ruff-0.16.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9b50c55e263103586b3dcf5f73d479eb8cb5fdb6098fec59a62891dab653717"}, + {file = "ruff-0.16.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ff4a79ce3ec0172f3241943835de1c4cb4e2dcd07f0f8c2d02603dbbbee4b17"}, + {file = "ruff-0.16.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e95c448fca1fb2a18372a9440926c5a6ee789639bb975c72e7ae6d0b04218ab4"}, + {file = "ruff-0.16.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f11a8d11010301d0a398a2fdef67691feca7294da6aef55e2150e8fa2cd520b"}, + {file = "ruff-0.16.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:48044c678e9cb8698246c99b14aaccfa6601dea7379eb48a6f8f73f7a6d86cd0"}, + {file = "ruff-0.16.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7aa0959bad8eb8bef50340154fc9b58678dae31fa4293afa38b44b6e552c0213"}, + {file = "ruff-0.16.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:28ea2b7df8ebf7f9da6b7d47b230ab48f387c0a29be3b474c4d0740e197bb9af"}, + {file = "ruff-0.16.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:33a3dfac8c35f81498dea9181bccc2f4c4bc8f1521a1dd9406e77643e0f0fb09"}, + {file = "ruff-0.16.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a5237a0bda500d30d81b8e07a6973a5cbc772864cbf746ae2f4e8a2e01c9f4ed"}, + {file = "ruff-0.16.0-py3-none-win32.whl", hash = "sha256:7fab76fa065c873f41ff744347c6e77bcc3dfec4bcc754dc26b63d23c0f7f5fb"}, + {file = "ruff-0.16.0-py3-none-win_amd64.whl", hash = "sha256:429c117f022bf481fabd9d551e7a3952b24c65e6ef44337ea09d90bebef14472"}, + {file = "ruff-0.16.0-py3-none-win_arm64.whl", hash = "sha256:14296fedcd2705c77ab8235439278bbb38f285cf7da5528b00b3e330c3d4872d"}, + {file = "ruff-0.16.0.tar.gz", hash = "sha256:e460aafd5495ec89efaa6ced2e4a9a581116451e1c88b9d37ef497e0f8e93982"}, ] [[package]] @@ -203,4 +203,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = "^3.10" -content-hash = "582e44ba3ca015b73f5da1d9acf7138784832d260e4d2037a25993ef43361bf9" +content-hash = "e45652062e947800c25fb0315ea40f894d78eba4cde1059ee00dda293fc8004b" diff --git a/pyproject.toml b/pyproject.toml index 75a12dd..8a71160 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,11 +34,11 @@ coverage = "^7.2.7" coverage = "^7.2.7" [tool.poetry.group.dev.dependencies] -ruff = "0.15.17" +ruff = "0.16.0" [tool.ruff] line-length = 80 -lint.extend-select = ["I"] +lint.select = ["E4", "E7", "E9", "F", "I"] [tool.ruff.lint.per-file-ignores] "__init__.py" = ["F401"]