Skip to content

Phases feature#53

Merged
RishabhJain2018 merged 1 commit intomasterfrom
phases-feature
Jun 26, 2018
Merged

Phases feature#53
RishabhJain2018 merged 1 commit intomasterfrom
phases-feature

Conversation

@guyandtheworld
Copy link
Member

@guyandtheworld guyandtheworld commented Jun 23, 2018

evalai challenge CHALLENGE phases
evalai challenge CHALLENGE phase PHASE

@coveralls
Copy link

coveralls commented Jun 23, 2018

Pull Request Test Coverage Report for Build 170

  • 76 of 82 (92.68%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 90.523%

Changes Missing Coverage Covered Lines Changed/Added Lines %
evalai/utils/challenges.py 67 73 91.78%
Totals Coverage Status
Change from base Build 166: 0.5%
Covered Lines: 277
Relevant Lines: 306

💛 - Coveralls

@guyandtheworld guyandtheworld force-pushed the phases-feature branch 2 times, most recently from 6776349 to 2be6247 Compare June 23, 2018 19:50
@RishabhJain2018
Copy link
Member

@isht3 Please resolve the conflicts here.

@RishabhJain2018
Copy link
Member

@isht3 More conflicts 😄

challenge = "{}{}{}{}".format(title, description, end_date, br)
cleaned_desc = BeautifulSoup(challenge["short_description"], "lxml").text
description = "{}\n".format(cleaned_desc)
date = "End Date : {}".format(style(challenge["end_date"].split("T")[0], fg="red"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date -> end_date

echo("Sorry, no challenges found!")


def pretty_print_challenge_phases(phases):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty_print_all_challenge_phases

phase_id = "Phase ID: {}\n\n".format(style(str(phase["id"]),
bold=True, fg="blue"))

title = "{} {} {}".format(phase_title, challenge_id, phase_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title -> phase_title

echo(err)
sys.exit(1)

response_json = response.json()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

response_json -> response

pretty_print_challenge_phases(phases)


def pretty_print_challenge_phase(phase):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty_print_challenge_phase_data

is_active = style("\nActive : {}\n".format(phase["is_active"]), bold=True)
is_public = style("\nPublic : {}\n".format(phase["is_public"]), bold=True)

phase = "{}{}{}{}{}{}{}{}{}{}".format(title, description, start_date,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phase -> challenge_phase

@guyandtheworld guyandtheworld force-pushed the phases-feature branch 2 times, most recently from 7f12a52 to c85a581 Compare June 25, 2018 10:17
@guyandtheworld
Copy link
Member Author

@RishabhJain2018 Made changes! :D

cleaned_desc = BeautifulSoup(challenge["short_description"], "lxml").text
description = "{}\n".format(cleaned_desc)
end_date = "End Date : {}".format(style(challenge["end_date"].split("T")[0], fg="red"))
date = "\n{}\n\n".format(style(end_date, bold=True))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isht3 I think you missed this one date -> end_date

description = "{}\n".format(cleaned_desc)
end_date = "End Date : {}".format(style(challenge["end_date"].split("T")[0], fg="red"))
date = "\n{}\n\n".format(style(end_date, bold=True))
challenge = "{}{}{}{}".format(title, description, date, br)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date -> end_date


def pretty_print_all_challenge_phases(phases):
"""
Function to print all the challenge phase of a challenge.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function to print all the challenge phases of a challenge


cleaned_desc = BeautifulSoup(phase["description"], "lxml").text
description = "{}\n\n".format(cleaned_desc)
phase = "{}{}{}".format(phase_title, description, br)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phase -> challenge_phase

cleaned_desc = BeautifulSoup(phase["description"], "lxml").text
description = "{}\n\n".format(cleaned_desc)
phase = "{}{}{}".format(phase_title, description, br)
echo(phase)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phase -> challenge_phase

responses.add(responses.POST, url.format(API_HOST_URL, URLS.participate_in_a_challenge.value).format("2", "3"),
body=Exception('...'))

# Phases URLS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phase URLS

self.expected = "Error: Sorry, the object does not exist."

@responses.activate
def test_display_phase_lists_for_object_does_not_exist(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to function name comment above.

assert response == self.expected

@responses.activate
def test_display_phase_details_for_object_does_not_exist(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to function name comment above.

assert result.exit_code == -1

@responses.activate
def test_challenge_phase_lists_for_request_exception(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to function name comment above.

assert result.exit_code == -1

@responses.activate
def test_challenge_phase_details_for_request_exception(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to function name comment above.

@guyandtheworld guyandtheworld force-pushed the phases-feature branch 2 times, most recently from d3bede5 to ed6711c Compare June 26, 2018 05:32
json=challenge_data, status=200)

challenges = challenge_data["results"]
challenges_json = challenge_data["results"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh...okay!

assert response == expected


class TestDisplayPhasesWhenObjectDoesNotExist(BaseTestClass):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor change TestDisplayChallengePhasesWhenObjectDoesNotExist

* Fetch phase lists

* Fetch phase details
Copy link
Member

@RishabhJain2018 RishabhJain2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@RishabhJain2018 RishabhJain2018 merged commit a23fdf0 into master Jun 26, 2018
@RishabhJain2018 RishabhJain2018 deleted the phases-feature branch June 26, 2018 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants