def test_per_project_table(self): """Generate valid table names for valid project IDs.""" self.assertEqual( 'plx.google:m_lab.ndt.all', table_names.per_project_table(constants.PROJECT_ID_NDT)) self.assertEqual( 'plx.google:m_lab.npad.all', table_names.per_project_table(constants.PROJECT_ID_NPAD)) self.assertEqual( 'plx.google:m_lab.sidestream.all', table_names.per_project_table(constants.PROJECT_ID_SIDESTREAM)) self.assertEqual('plx.google:m_lab.paris_traceroute.all', table_names.per_project_table( constants.PROJECT_ID_PARIS_TRACEROUTE))
def test_per_project_table_rejects_invalid_projects(self): """Reject invalid M-Lab project IDs.""" with self.assertRaises(ValueError): table_names.per_project_table(500)
def _generate_per_project_query(self): tables = [table_names.per_project_table(self._project)] conditions = [self._format_time_range_condition()] return _construct_test_id_subquery(tables, conditions)