Skip to content

Commit

Permalink
Added solution to the Spongecase challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
likechrisss committed Dec 29, 2024
1 parent b4cf55a commit d19de11
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 65 deletions.
13 changes: 13 additions & 0 deletions solutions/spongecase_challenge.py → solutions/spongecase.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A module for converting strings into SpongeCase (alternating lower and upper case).
Module contents:
- spongecase: Converts a string into SpongeCase
Created on 28/12/2024
Author: Chrismy Leprince Paul Augustin
"""


def spongecase(text: str) -> str:
"""
Convert a given string into SpongeCase, where letters alternate
Expand Down
59 changes: 0 additions & 59 deletions solutions/tests/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module contains unit tests for the `spongecase` function.
The tests validate various scenarios, such as:
- Basic strings with spaces
- Single words
- Empty strings
Test module for spongecase function.
Test categories:
- Basic cases: typical strings, single words
- Edge cases: empty string, all uppercase, all lowercase
- Special characters: punctuation, digits, symbols
Created on 2024-12-28
Author: Chrismy Leprince Paul Augustin
"""
import unittest
from solutions.spongecase_challenge import spongecase

from solutions.spongecase import spongecase

class TestSpongeCase(unittest.TestCase):
"""Unit tests for the spongecase function."""
Expand Down

0 comments on commit d19de11

Please sign in to comment.