Best Python code snippet using pandera_python
test_cookbook.py
Source:test_cookbook.py
...81 }82 pe.save_book_as(dest_file_name=self.testfile4,83 bookdict=self.content4)84 @raises(ValueError)85 def test_update_columns(self):86 bad_column = {"A": [31, 1, 1, 1, 1]}87 # try non-existent column first88 pe.cookbook.update_columns(self.testfile, bad_column)89 @raises(NotImplementedError)90 def test_update_columns2(self):91 custom_column = {"Z": [33, 44, 55, 66, 77]}92 pe.cookbook.update_columns(self.testfile, custom_column)93 r = pe.SeriesReader("pyexcel_%s" % self.testfile)94 data = r.dict95 assert data["Z"] == custom_column["Z"]96 pe.cookbook.update_columns(self.testfile, custom_column, "test4.xls")97 r = pe.SeriesReader("test4.xls")98 data = r.dict99 assert data["Z"] == custom_column["Z"]...
ncaab_team_stats_test.py
Source:ncaab_team_stats_test.py
...4import pandas as pd5class MyTest(unittest.TestCase):6 def setUp(self):7 self.df = get_stat_df('https://www.cbssports.com/college-basketball/stats/team/team/blocks/ACC/')8 def test_update_columns(self):9 new_columns = update_columns(self.df)10 assert new_columns == ['Team', 'Conf', 'GP', 'BLK', 'BPG']11 def test_get_stat_df(self):12 assert self.df is not None13 assert self.df.shape[0] == 1514 assert self.df.shape[1] == 515 def test_conference_dictionary(self):16 urls = conference_dictionary('ACC')17 assert urls['scoring'] == 'https://www.cbssports.com/college-basketball/stats/team/team/scoring/ACC/'18 assert urls['rebounding'] == 'https://www.cbssports.com/college-basketball/stats/team/team/rebounds/ACC/'19 assert urls['passing'] == 'https://www.cbssports.com/college-basketball/stats/team/team/assists-turnovers/ACC/'20 assert urls['steals'] == 'https://www.cbssports.com/college-basketball/stats/team/team/steals/ACC/'21 assert urls['blocks'] == 'https://www.cbssports.com/college-basketball/stats/team/team/blocks/ACC/'22 def rank_teams_test(self):...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!