Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanfdo18098 committed Nov 26, 2024
1 parent 831f083 commit 157e9b1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pages/students/e21/e21087.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

url_cv: #
url_website: #
url_linkedin:https://www.linkedin.com/in/shihara-dewagedara-23109a275/
url_github:https://github.com/Shihara1020
url_linkedin: https://www.linkedin.com/in/shihara-dewagedara-23109a275/
url_github: https://github.com/Shihara1020
url_facebook: #
url_researchgate: #
url_twitter: #
Expand Down
2 changes: 1 addition & 1 deletion pages/students/e21/e21130.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
email_faculty: [email protected]
email_personal: [email protected]

location:G/158,Mosque road, Kottawaththa, Mawanella.
location: G/158,Mosque road, Kottawaththa, Mawanella.

url_cv: #
url_website: #
Expand Down
46 changes: 46 additions & 0 deletions tests/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,52 @@ def test_All_students_external_urls_have_http_or_https(self):
self.fail(
"URL in " + filePath + " does not contain http"
)

def test_student_pages_have_space_after_colon(self):
# page will not show up if the space is not there

studentsFolder = "../pages/students"
for eachFolder in os.listdir(studentsFolder):
# e18 e19 etc

# skip the html files and the indexPages folder
if "indexPages" in eachFolder or ".html" in eachFolder:
continue

for eachStudent in os.listdir(studentsFolder + "/" + eachFolder + "/"):
# e18098.html e18xxx.html files
filePath = studentsFolder + "/" + eachFolder + "/" + eachStudent

with open(filePath, "r") as f:
# inside of each file

triple_dash_count = 0
for eachLine in f:
eachLine = eachLine.strip()

if triple_dash_count == 2: # if frontmatter has ended
break

if eachLine == "---": # keeping track of frontmatter
triple_dash_count += 1
continue

if ":" not in eachLine: # if no colon in the line
continue

splitted = eachLine.split(":")

if len(splitted) == 1:
continue

word_after_colon = splitted[1]

if len(word_after_colon) > 0:
first_character_after_colon = word_after_colon[0]

if first_character_after_colon != " ":
self.fail("No space after colon in " + filePath)



if __name__ == "__main__":
Expand Down

0 comments on commit 157e9b1

Please sign in to comment.