Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Revert "Add custom coverage test"
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankLawrence committed Jun 12, 2024
1 parent 45156c5 commit 65d4e28
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions discord/colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import colorsys
import random
import re
from cov import test, mark

from typing import TYPE_CHECKING, Optional, Tuple, Union

Expand All @@ -52,22 +51,17 @@ def parse_hex_number(argument: str) -> Colour:
else:
return Color(value=value)

@test(5)

def parse_rgb_number(number: str) -> int:
if number[-1] == '%':
mark(0)
value = float(number[:-1])
if not (0 <= value <= 100):
mark(1)
raise ValueError('rgb percentage can only be between 0 to 100')
mark(2)
return round(255 * (value / 100))

value = int(number)
if not (0 <= value <= 255):
mark(3)
raise ValueError('rgb number can only be between 0 to 255')
mark(4)
return value


Expand Down

0 comments on commit 65d4e28

Please sign in to comment.