sapling/eden/integration/casing_test.py
Xavier Deguillard a29d465ee8 fs: fix license header
Summary:
With Facebook having been renamed Meta Platforms, we need to change the license
headers.

Reviewed By: fanzeyi

Differential Revision: D33407812

fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
2022-01-04 15:00:07 -08:00

41 lines
1.2 KiB
Python

#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
import os
import sys
from .lib import testcase
@testcase.eden_repo_test
# pyre-ignore[13]: T62487924
class CasingTest(testcase.EdenRepoTest):
"""Verify that EdenFS behave properly when configured to be case
insensitive and case preserving.
"""
is_case_insensitive: bool
def populate_repo(self) -> None:
self.is_case_insensitive = sys.platform == "win32"
self.repo.write_file("adir1/adir2/a", "Hello!\n")
self.repo.commit("a")
def test_insensitive(self) -> None:
if self.is_case_insensitive:
self.assertEqual(self.read_file("adir1/adir2/A"), "Hello!\n")
def test_case_preserving(self) -> None:
if self.is_case_insensitive:
self.assertEqual(self.read_file("adir1/adir2/A"), "Hello!\n")
self.assertEqual(os.listdir(self.get_path("adir1/adir2")), ["a"])
def test_case_preserving_new_files(self) -> None:
if self.is_case_insensitive:
self.write_file("MixedCaseFile", "content\n")
self.assertIn("MixedCaseFile", os.listdir(self.get_path("")))