Example #1
0
 def test_it_returns_the_right_columns(self):
     df = build_dataframe_from_users(self.users)
     self.assertCountEqual(df.columns, [
         "bsas_ocurrencias",
         "bsas_usuarios",
         "cba_ocurrencias",
         "cba_usuarios",
     ])
Example #2
0
    def test_it_counts_in_cba(self):
        df = build_dataframe_from_users(self.users)

        self.assertEqual(df.loc["hola"]["cba_ocurrencias"], 1)
        self.assertEqual(df.loc["mundo"]["cba_ocurrencias"], 1)
        self.assertEqual(df.loc["culia"]["cba_ocurrencias"], 3)
        self.assertEqual(df.loc["gato"]["cba_ocurrencias"], 5)

        self.assertEqual(df.loc["hola"]["cba_usuarios"], 1)
        self.assertEqual(df.loc["mundo"]["cba_usuarios"], 1)
        self.assertEqual(df.loc["culia"]["cba_usuarios"], 3)
        self.assertEqual(df.loc["gato"]["cba_usuarios"], 2)
Example #3
0
    def test_it_counts_users(self):
        df = build_dataframe_from_users(self.users)

        self.assertEqual(df.loc["hola"]["bsas_usuarios"], 1)
        self.assertEqual(df.loc["mundo"]["bsas_usuarios"], 1)
Example #4
0
 def test_it_returns_the_given_words(self):
     df = build_dataframe_from_users(self.users)
     self.assertCountEqual(df.index, ["hola", "mundo", "gato", "culia"])
Example #5
0
    def test_it_counts_occurrences(self):
        df = build_dataframe_from_users(self.users)

        self.assertEqual(df.loc["hola"]["bsas_ocurrencias"], 2)
        self.assertEqual(df.loc["mundo"]["bsas_ocurrencias"], 2)