Skip to content

Ilya_Torch_itorch2001@gmail.com#8

Open
IlyaTorch wants to merge 50 commits into
epam-python-courses-7-bsu:masterfrom
IlyaTorch:master
Open

Ilya_Torch_itorch2001@gmail.com#8
IlyaTorch wants to merge 50 commits into
epam-python-courses-7-bsu:masterfrom
IlyaTorch:master

Conversation

@IlyaTorch

Copy link
Copy Markdown

Iteration 1
Options --version, --json, --limit, --verbose are ready. Add option --verbose. Split classes into files. Add description of project to file README.md.

Options --version, --json, --limit are ready. Split classes into files.

 Iteration 1
    Options --version, --json, --limit are ready. Split classes into files.
Add option cl  verbose
Add description of project to file README.md
Comment thread final_task/README.md Outdated
Comment thread final_task/rss_reader/Entry.py Outdated
Comment thread final_task/rss_reader/Entry.py
Comment thread final_task/rss_reader/Entry.py Outdated
Comment thread final_task/rss_reader/Handler.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Please do NOT close this and open new pull request anymore, Our comments do not save and it is hard to track your progress

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is some feedback about your application work:

  1. If you to check version without specifying RSS url, you wil get:
    rss_reader.py: error: the following arguments are required: source
    It should be that you do not need any RSS url for checking app version.
  2. You got some problems with encoding. Check image below:

image

  1. If limit is not specified you will get only 1 piece of news right now, while it should give you the whole available feed
  2. Sometimes you do not get image link in "Links" (see the image below)

image

P.S. I used --limit 999 option to test last threee points.

@HenadziStantchik HenadziStantchik added the reviewed Review was performed label Nov 5, 2019
@IlyaTorch

Copy link
Copy Markdown
Author

1), 3) -fixed
2) Is it necessary?
4) Img tag exists on this page and it has an attribute "alt" while it doesn't have an attribute "src". What do I need to do in this case?

Remove redundants strings and correct method parse_html in the file Entry.py, Remove redundants empty lines in all the files. Make a decorator for logging and move to other file Logging. Combine parsing command line args into function and move it to other file Console_parse. Fixe the error when check version without RSS url. And fixe output: print whole available feed instead of an article.
@HenadziStantchik

HenadziStantchik commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator
  1. Is it necessary?

Yes

  1. Img tag exists on this page and it has an attribute "alt" while it doesn't have an attribute "src". What do I need to do in this case?

That is certainly strange. Did you visit the url? if there is no src then there should be no image available on the page.

P.S. In the future use labels. Check slack for more info.

Comment thread final_task/rss_reader/Handler.py Outdated
Comment thread final_task/rss_reader/rss_reader.py Outdated
Remove unsed improts in files Entry.py, rss_reader.py
@HenadziStantchik HenadziStantchik added please review I want mentors to review my PR ASAP and removed reviewed Review was performed labels Nov 6, 2019
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Also please do not request review using site interface, because it triggers a bit different functionality and compells us to create feedbacks abouth your PR and either merge it or close it. Cancel review request please

@HenadziStantchik HenadziStantchik removed the please review I want mentors to review my PR ASAP label Nov 6, 2019
Edit output of links in file Handler.py; Edit fiel README.md; Add files ConsoleParse.py and Logging.py; Add parsing special symbols and ASCII codes to function parse_html (file Entry.py)
@IlyaTorch

Copy link
Copy Markdown
Author

When can I cancel review request?

Remove condition extra condition from file Handler.py and add argument limit check; Remove adding img-links without attr src
@HenadziStantchik

Copy link
Copy Markdown
Collaborator

When launching your application in this way:
python rss_reader.py https://news.yahoo,com/rss/
I get an exception:
image
This bug is inconsistent because this appears not every application run.

Comment thread final_task/rss_reader/Entry.py Outdated
@IlyaTorch

Copy link
Copy Markdown
Author

It's strange because when I launch application using:
python rss_reader.py https://news.yahoo,com/rss/
command I get only my expect-exception.
image

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

I have no problems with encoding in all my browsers. I rewrote write_entries_to_html methon but I'm not sure that it'll help. What can I do with it?

Then this means that the problem on my side. It is ok then.

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

I did not discover any more issues with iteration 4

Add tests fo class Entry; Edit output methods and correct writing of date for Entry objects; Edit some Handler class methods using context managers for working with files and checking if file exists with os.path.exists() and using isinstance() function istead of type(*) == ?; Simplify if-else structure in rss_reader.py file
Edit converting to html and pdf functions for case of several images on the page
Add some tests
@IlyaTorch

Copy link
Copy Markdown
Author

Please look at my tests. Can you explain me why, when I add new tests, % of coverage doesn't change?

@IlyaTorch IlyaTorch changed the title Ilya_Torch_itorch2001@gmail.com Ilya_Torch_itorch2001@gmail.com- PLEASE REVIEW Nov 23, 2019
@IlyaTorch

IlyaTorch commented Nov 23, 2019

Copy link
Copy Markdown
Author

And how do the files for which I didn't write a single test show 100% coverage? I check coverage so
coverage run rss_reader.py
coverage report -m or coverage html

@IlyaTorch

Copy link
Copy Markdown
Author

image
I wrote tests only for files Entry.py and Hanler.py

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Coverage for exceptions is 100% because they do not contain any statements that need to be tested, only class declarations.

Coverage for logging is 100% because you decorated almost every function with logging decorator, so it implicitly called in each your test, so the coverage thinks that you tested it.

If you wrote tests only for entry and handler and there is some percentage on other modules, that means that the functions you wrote tests for call some functions from other modules and this makes coverage think that you tested these functions too.

Try to check some documentation on coverage, I am sure you will find solution to your problem

@HenadziStantchik HenadziStantchik changed the title Ilya_Torch_itorch2001@gmail.com- PLEASE REVIEW Ilya_Torch_itorch2001@gmail.com Nov 24, 2019
Add more tests for Entry and Handler classes
Add more tests for Entry and Handler classes
Move tests to the rss_reader folder; Add prints when html and pdf documents were created
Move tests to rss_reader folder
Add dockstrings;
Change memu options; Delete extra exceptions in Handler
Comment thread final_task/README.md
Comment on lines +14 to +19
5 mains files of project:
* rss_reader.py - the file which runs the application
* ConsoleParse.py - contains code which parses arguments from console
* Entry.py - contains class Entry which represent an article
* Handler.py - contains class Handler which performes functions of processing objects Entry
* Logging.py - contains decorator for printing loggs in stdout

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would be nice if you kept it up to date.

@HenadziStantchik

Copy link
Copy Markdown
Collaborator

Here is feedback on your application:
Iteration 1:
--json does not work with Cyrillic symbols.
Iteration 2:
Installs fine, all iterations work.
Iteration 3:
User should be able specify date in YYYYMMDD:
image
Iteration 4:
Everything works fine.

Commit messages are very informative and correspond to the recommended commit message style.
Code is well structured and readable, but there are some large methods which lower readability a bit. The code corresponds to the PEP8 guidelines.
Tests are decent, but some of them are failing test_write_entries_to_html (and without). keep in mind that tests should not depend on any external factors such as OS or etc. Coverage percentage is high enough.

IlyaTorch and others added 6 commits January 2, 2020 20:02
Add work --json with Cyrillic symbols. Correct date format  in YYYYMMDD
Edit saving of the news cache
Add search by url in date option
Add colorize option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants