Giter VIP home page Giter VIP logo

html-css-grade's Issues

Remove logging cssutils.log.setLog(newlog)

Issue with some CSS checks is the logging in cssutils. Need to add:

import logging
logging.basicConfig(filename="newfile.log",
                    format='%(asctime)s %(message)s',
                    filemode='w')
newlog = logging.getLogger()
cssutils.log.setLog(newlog)

To not send logs to stderr

Comments in CSS can mess with some logic

Code with comments like this:

  /* Styling for the morning and afternoon session titles */
  .morn, .noon {
    background-color: #bd94ff;
    padding-left: 0.5em;
    font-size: 16px;
    font-weight: bold;
    margin-top: 0px;
    box-sizing: border-box;
    border-collapse: separate;
    text-indent: initial;
    border-spacing: 2px;

  }
  
  /* General styling for the table */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
  }

Mess with properly running tests as the comment object does not have selectorTest and other attributes.

Error list index out of range with learner_html.check_HTML

Thank you for your efforts with this code it is very useful.
I do get an error with learner_html.check_HTML whenever I use it irrespective of the string I pass.

learner_html.check_HTML("p")
will produce the following error
`test_check_html (coding_rooms_unit_tests.CodingRoomsUnitTests) ... True
ERROR

======================================================================
ERROR: test_check_html (coding_rooms_unit_tests.CodingRoomsUnitTests)

Traceback (most recent call last):
File "/usercode/coding_rooms_unit_tests.py", line 10, in test_check_html
print(learner_html.check_HTML("p"))
File "/usr/lib/python3/dist-packages/htmlcssgrade.py", line 50, in check_HTML
return (code_snip.casefold().replace(" ", "").replace("\n", "") in str(self.html_obj.contents[2]).casefold().replace(" ", "").replace("\n", ""))
IndexError: list index out of range


Ran 1 test in 0.001s

FAILED (errors=1)`

my code is

`import unittest
import htmlcssgrade

class CodingRoomsUnitTests(unittest.TestCase):

def test_check_html(self):
    
    learner_html = htmlcssgrade.HTML_Check("index.html")
    print(learner_html.check_element_used("p"))
    print(learner_html.check_HTML("p"))`

any help would be much appreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.