HackerTrans
トップ新着トレンドコメント過去質問紹介求人

a-r-t

no profile record

コメント

a-r-t
·10 か月前·議論
Nice to see a Festool miter saw in his shop, Lynch knew what he was doing.
a-r-t
·5 年前·議論
One of the examples they provide on copilot.github.com shows a unit test for strip_suffix function. It does not test for a file name without a suffix, which the function would fail (it removes the last character instead):

    def strip_suffix(filename):
        """
        Removes the suffix from a filename
        """
        return filename[:filename.rfind('.')]

    import unittest

    def test_strip_suffix():
        """
        Tests for the strip_suffix function
        """
        assert strip_suffix('notes.txt') == 'notes'
        assert strip_suffix('notes.txt.gz') == 'notes.txt'