This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Navbar',() => { | |
it('should get success request to api and render the poins on navbar', async () => { | |
const displayPontos = await screen.findByTestId('display-pontos') | |
const getPontos = await ApiClient().get('ponto/total/user') | |
expect(displayPontos).toHaveTextContent(`${getPontos.data.total}`) | |
}) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const valor = 307049997; | |
var f = (valor/100).toLocaleString('pt-br',{style: 'currency', currency: 'BRL'}); | |
//'R$ 3.070.499,97' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Livros { | |
String [] livros = {"O labirinto do fauno","Seja o amor da sua vida","O corpo fala"}; | |
public String toString() { | |
StringBuilder str = new StringBuilder(); | |
for (var l: livros) { | |
str.append(l).append(System.getProperty("line.separator")); | |
} | |
return str.toString(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS media( | |
id SERIAL PRIMARY KEY, | |
label VARCHAR(256), | |
type media_type, | |
"companyCode" VARCHAR(100), | |
"companyId" INT | |
); | |
CREATE TABLE IF NOT EXISTS media_file( | |
id SERIAL PRIMARY KEY, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num = int(input('Digite o numero para a tabuada: ')) | |
for mult in range(1,11): | |
print(f'{num} x {mult} = {num*mult}') | |
cont = input('Deseja ver a tabuada de outro número? (S/N)') | |
while cont[0].lower() == 's': | |
num = int(input('Digite o numero para a tabuada: ')) | |
for mult in range(1,11): | |
print(f'{num} x {mult} = {num*mult}') | |
cont = input('Deseja ver a tabuada de outro número? (S/N)') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, pandas as pd, json | |
from requests import RequestException | |
def getAPI(): | |
url = "https://olinda.bcb.gov.br/olinda/servico/PTAX/versao/v1/odata/CotacaoMoedaPeriodo(moeda=@moeda,dataInicial=@dataInicial,dataFinalCotacao=@dataFinalCotacao)?@moeda='USD'&@dataInicial='01-01-2022'&@dataFinalCotacao='01-05-2023'&$top=100000000&$format=json&$select=paridadeCompra,paridadeVenda,cotacaoCompra,cotacaoVenda,dataHoraCotacao,tipoBoletim" | |
payload={} | |
headers = {} | |
try: | |
response = requests.request("GET", url, headers=headers, data=payload) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE grupo_selecoes( | |
nome_grupo char NOT NULL, | |
id_selecao smallint NOT NULL references selecao(id), | |
pontos smallint NOT NULL default 0 CHECK (pontos >= 0), | |
jogos smallint NOT NULL default 0 CHECK (pontos >= 0), | |
vitorias smallint NOT NULL default 0 CHECK (pontos >= 0) , | |
empates smallint NOT NULL default 0 CHECK (pontos >= 0) , | |
derrotas smallint NOT NULL default 0 CHECK (pontos >= 0) , | |
PRIMARY KEY (nome_grupo, id_selecao), | |
CHECK (nome_grupo in ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS media_file( | |
id SERIAL PRIMARY KEY, | |
img BYTEA, | |
mimetype VARCHAR(15), | |
media INT REFERENCES media(id) ON DELETE CASCADE | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tokn = null //essa é variável global durante a execução dos testes que irá armazenar o token | |
... | |
before(function(done) { | |
api.post('/ingefood/login') | |
.send({ | |
"login": "teste", | |
"password": "essaéaminhasenhasuperseguraparaseauthenticarnestaapi." | |
}) | |
.expect(200) | |
.end(function(err, res) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mysql = require('mysql'); | |
const db = mysql.createConnection({ | |
connectionLimit : 10, | |
host : process.env.DATABASE_HOST, | |
user : process.env.DATABASE_USER, | |
password : process.env.DATABASE_PASSWORD, | |
database : process.env.DATABASE_NAME | |
}); | |
db.connect(function(err) { |
NewerOlder